链表
文章平均质量分 78
sscssz
这个作者很懒,什么都没留下…
展开
-
【leetcode题解】【E】【97】Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Subscribe to see which companies asked th原创 2015-12-14 19:13:21 · 247 阅读 · 0 评论 -
【VIP】【链表翻转】234. Palindrome Linked List【E】【94】
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? Subscribe to see which companies asked this question原创 2016-04-05 10:43:31 · 395 阅读 · 0 评论 -
109. Convert Sorted List to Binary Search Tree【M】【33】【leetcode题解】
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Subscribe to see which companies asked this question 从给定的有序链表生成平衡二叉树。 解原创 2016-02-23 15:24:41 · 410 阅读 · 0 评论 -
2. Add Two Numbers 【M】【72】【leetcode】
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link原创 2016-03-31 17:48:41 · 305 阅读 · 0 评论 -
203. Remove Linked List Elements【E】【70】【leetcode】
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6 Return: 1 --> 2 --> 3 --> 4 --> 5 Credits: Special thank原创 2016-03-19 15:19:35 · 675 阅读 · 0 评论 -
61. Rotate List【M】【54】【leetcode】
Given a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. Subscribe to see which原创 2016-03-18 16:30:34 · 359 阅读 · 0 评论 -
86. Partition List【M】【48】【leetcode题解】
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 original relative order of the nodes in each of原创 2016-03-16 19:16:15 · 337 阅读 · 0 评论 -
328. Odd Even Linked List[E][86]【leetcode】
Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes. You should try to do it in原创 2016-02-14 15:20:08 · 378 阅读 · 0 评论 -
【leetcode题解】【E】【61.5】Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the原创 2015-12-19 01:17:33 · 263 阅读 · 0 评论 -
【leetcode】382. Linked List Random Node【M】【74】
Given a singly linked list, return a random node's value from the linked list. Each node must have the same probability of being chosen. Follow up: What if the linked list is extremely large and i原创 2016-11-04 21:41:09 · 407 阅读 · 0 评论