总结:其实就是反转链表。不过是反转中间一部分。要注意的是保存第一个结点的前继的指针; 若第一个结点是头结点,注意反转子串的尾结点变为头结点。
分类:
其他好文 时间:
2014-08-25 01:07:43
阅读次数:
198
Add Two Numbers
Total Accepted: 20255 Total
Submissions: 88115My Submissions
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order a...
分类:
其他好文 时间:
2014-08-23 21:40:01
阅读次数:
200
Example 1: Write a function to reverse a string.Example Java code: public static String reverse ( String s ) { int length = s.length(), last =length ....
分类:
其他好文 时间:
2014-08-22 19:42:59
阅读次数:
236
Evaluate Reverse Polish NotationEvaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may ...
分类:
其他好文 时间:
2014-08-22 12:18:26
阅读次数:
135
Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Clari...
分类:
其他好文 时间:
2014-08-22 10:30:55
阅读次数:
109
Partition List
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...
分类:
其他好文 时间:
2014-08-21 19:23:34
阅读次数:
295
Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about th...
分类:
其他好文 时间:
2014-08-21 19:07:04
阅读次数:
142
Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the". click to show clarification.C...
分类:
其他好文 时间:
2014-08-20 13:59:42
阅读次数:
229
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2014-08-20 13:57:52
阅读次数:
176
设置:auth.login(request, user) response = HttpResponseRedirect(reverse("index")) response.set_cookie('xiang', username, 3600) return response获取: def in....
分类:
其他好文 时间:
2014-08-20 13:50:42
阅读次数:
225