上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 32 下一页
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. //剑指offer删除链表中重复的结点 Fo 阅读全文
posted @ 2019-04-09 16:19 MarkLeeBYR 阅读(84) 评论(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 tox. You should preserve the o 阅读全文
posted @ 2019-04-09 16:19 MarkLeeBYR 阅读(98) 评论(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 阅读(106) 评论(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 阅读(88) 评论(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 阅读(87) 评论(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 阅读(90) 评论(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 阅读(84) 评论(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 阅读(93) 评论(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 阅读(111) 评论(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 阅读(109) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 32 下一页