上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 37 下一页
摘要: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
posted @ 2018-12-26 17:37 fatttcat 阅读(118) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2018-12-26 16:23 fatttcat 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if a permutation of the string could form a palindrome. Example 1: Example 2: Example 3: 扫一遍s,统计频率,奇数频率最多只能出现一次。用cnt表示结果,cnt 阅读全文
posted @ 2018-12-26 16:04 fatttcat 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: Follow up:Could you do it in O(n) time and O(1) space? 找中点,反转后半部分,再 阅读全文
posted @ 2018-12-26 11:15 fatttcat 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have value val. Example: time: O(n), space: O(1) 阅读全文
posted @ 2018-12-26 11:06 fatttcat 阅读(91) 评论(0) 推荐(0) 编辑
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
posted @ 2018-12-26 10:22 fatttcat 阅读(66) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nodes its 阅读全文
posted @ 2018-12-26 10:08 fatttcat 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middl 阅读全文
posted @ 2018-12-24 15:02 fatttcat 阅读(111) 评论(0) 推荐(0) 编辑
摘要: A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Write a function to determine if a number i 阅读全文
posted @ 2018-12-24 09:34 fatttcat 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2018-12-24 09:23 fatttcat 阅读(100) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 37 下一页