上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 32 下一页
摘要: Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal tox. You should preserve the o 阅读全文
posted @ 2019-04-09 16:19 MarkLeeBYR 阅读(102) 评论(0) 推荐(0)
摘要: Sort a linked list in O(n log n) time using constant space complexity. //利用归并排序的思想 class Solution { public ListNode sortList(ListNode head) { if (head 阅读全文
posted @ 2019-04-09 16:17 MarkLeeBYR 阅读(110) 评论(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 @ 2019-04-09 16:15 MarkLeeBYR 阅读(92) 评论(0) 推荐(0)
摘要: Sort a linked list using insertion sort. public class Solution { public ListNode insertionSortList(ListNode head) { ListNode root = new ListNode(0); / 阅读全文
posted @ 2019-04-09 16:15 MarkLeeBYR 阅读(89) 评论(0) 推荐(0)
摘要: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up:Can you 阅读全文
posted @ 2019-04-09 16:14 MarkLeeBYR 阅读(94) 评论(0) 推荐(0)
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
posted @ 2019-03-15 16:16 MarkLeeBYR 阅读(88) 评论(0) 推荐(0)
摘要: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two orzero sub-node. I 阅读全文
posted @ 2019-03-15 16:13 MarkLeeBYR 阅读(96) 评论(0) 推荐(0)
摘要: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文
posted @ 2019-03-15 16:12 MarkLeeBYR 阅读(113) 评论(0) 推荐(0)
摘要: Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. S 阅读全文
posted @ 2019-03-15 16:11 MarkLeeBYR 阅读(112) 评论(0) 推荐(0)
摘要: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
posted @ 2019-03-15 16:09 MarkLeeBYR 阅读(88) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 32 下一页