Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:
编程语言 时间:
2014-07-12 13:13:24
阅读次数:
195
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 example,
Given {1,2,3,4}, reorder it t...
分类:
其他好文 时间:
2014-07-10 20:43:37
阅读次数:
210
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Valid operators are +, -, *, /.
Each operand may be an integer or another expression.
Some examples:
["2", "1", ...
分类:
其他好文 时间:
2014-07-10 19:39:53
阅读次数:
146
题目:
Given an input string, reverse the string word by word.
For example,
Given s = "the sky is blue",
return "blue is sky the".
java代码:
{CSDN:CODE:422957}...
分类:
其他好文 时间:
2014-07-10 17:26:26
阅读次数:
136
Write code to partition a linked list around a value x, such that all nodes less than x come before all nodes greater than or equal to x.Use two addit...
分类:
其他好文 时间:
2014-07-09 17:44:36
阅读次数:
159
You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the Ts d...
分类:
其他好文 时间:
2014-07-09 15:35:19
阅读次数:
176
Implement a function to check if a linked list is a palindrome.Reverse the second half of the list and then compare it with the first half./* Assume t...
分类:
其他好文 时间:
2014-07-09 14:25:04
阅读次数:
176
Evaluate the value of an arithmetic expression in Reverse Polish Notation.
分类:
其他好文 时间:
2014-07-08 22:28:14
阅读次数:
176
You have two numbers represented by a linked list, where each node contains a single digit. The digits are stored in reverse order, such that the 1’s ...
分类:
其他好文 时间:
2014-07-08 13:34:40
阅读次数:
195
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.Cl...
分类:
其他好文 时间:
2014-07-08 10:26:31
阅读次数:
240