单链表反转(Singly Linked Lists in Java)博客分类:数据结构及算法Java代码packagedsa.linkedlist;publicclassNode{Edata;Nodenext;}Java代码packagedsa.linkedlist;publicclassRever...
分类:
编程语言 时间:
2014-06-28 17:47:36
阅读次数:
232
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 ...
分类:
其他好文 时间:
2014-06-28 14:31:12
阅读次数:
201
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Analysis: typical Runner Technique. 一次过 1 ...
分类:
其他好文 时间:
2014-06-28 13:44:51
阅读次数:
164
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it without using extra space?一次...
分类:
其他好文 时间:
2014-06-28 13:38:14
阅读次数:
171
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No...
分类:
其他好文 时间:
2014-06-28 13:23:40
阅读次数:
150
题目:Flatten Binary Tree to Linked ListGiven a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 ...
分类:
其他好文 时间:
2014-06-24 09:09:02
阅读次数:
147
/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
分类:
其他好文 时间:
2014-06-22 23:59:58
阅读次数:
244
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.
For example,
Given 1->2->3->3->4->4->5, return 1->2->5.
Given 1->1-...
分类:
其他好文 时间:
2014-06-22 22:57:49
阅读次数:
347
Arrayss work well for unordered sequences, and even for...
分类:
其他好文 时间:
2014-06-22 21:45:52
阅读次数:
184
Linked List CycleGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Linked List Cycle IIGiven...
分类:
其他好文 时间:
2014-06-20 20:46:58
阅读次数:
245