Description :Given a singly linked list where
elements are sorted in ascending order, convert it to a height balanced
BST.分析:这道题目简单版是把一个排序好的数组转成平衡的二叉树...
分类:
其他好文 时间:
2014-06-16 10:51:54
阅读次数:
237
原题地址:https://oj.leetcode.com/problems/remove-duplicates-from-sorted-list-ii/题意:Given
a sorted linked list, delete all nodes that have duplicate number...
分类:
编程语言 时间:
2014-06-16 10:40:35
阅读次数:
340
Insertion Sort ListSort a linked list using
insertion sort. leetcode
subject思路:标准的插入排序。考察一下链表的操作。对链表进行插入排序的正确方法是:新建一个头节点,遍历原来的链表,对原链表的每个节点找到新链表中适合插入位置...
分类:
其他好文 时间:
2014-06-16 00:34:07
阅读次数:
364
原题地址:https://oj.leetcode.com/problems/merge-two-sorted-lists/题意:Merge two sorted linked lists and return it as a new list. The new list should be made...
分类:
编程语言 时间:
2014-06-15 21:58:31
阅读次数:
238
原题地址:https://oj.leetcode.com/problems/reverse-nodes-in-k-group/题意:Given a linked list, reverse the nodes of a linked listkat a time and return its mod...
分类:
编程语言 时间:
2014-06-15 21:24:43
阅读次数:
293
Description:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->...
分类:
其他好文 时间:
2014-06-15 07:35:31
阅读次数:
151
Swap Nodes in Pairs:Given a linked list, swap every
two adjacent nodes and return its head.For example,Given1->2->3->4, you
should return the list as2...
分类:
其他好文 时间:
2014-06-13 17:04:27
阅读次数:
180
Given a binary tree, flatten it to a linked
list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2014-06-13 15:11:35
阅读次数:
273
Linked List Cycle:Given a linked list, determine if
it has a cycle in it.Follow up:Can you solve it without using extra
space?解题分析:大致思想就是设置两个指针,一个指针每次...
分类:
其他好文 时间:
2014-06-13 14:41:54
阅读次数:
238