上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要: Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain lea 阅读全文
posted @ 2016-09-14 13:22 咖啡中不塌缩的方糖 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2016-09-14 12:56 咖啡中不塌缩的方糖 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Description: Count the number of prime numbers less than a non-negative number, n. 埃拉托斯特尼筛法 阅读全文
posted @ 2016-09-14 05:52 咖啡中不塌缩的方糖 阅读(102) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a 阅读全文
posted @ 2016-09-14 05:45 咖啡中不塌缩的方糖 阅读(272) 评论(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 @ 2016-09-14 04:23 咖啡中不塌缩的方糖 阅读(93) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. BST 阅读全文
posted @ 2016-09-14 03:58 咖啡中不塌缩的方糖 阅读(91) 评论(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 must do this in-place without altering the nodes' values. For 阅读全文
posted @ 2016-09-14 03:12 咖啡中不塌缩的方糖 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
posted @ 2016-09-14 00:00 咖啡中不塌缩的方糖 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list using insertion sort. public ListNode InsertionSortList(ListNode head) { if(head == null || head.next == null) return head; ListNod 阅读全文
posted @ 2016-09-13 12:57 咖啡中不塌缩的方糖 阅读(109) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time and O(1) space? 先用2 pointer查找到中间点,然后后半部分reverse, 最 阅读全文
posted @ 2016-09-13 11:52 咖啡中不塌缩的方糖 阅读(108) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页