Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:
其他好文 时间:
2014-07-18 20:06:13
阅读次数:
255
Not very hard to figure out the solution: splitting the list into 2 halves; reverse the 2nd half and interleave the two halves.But it takes some time ...
分类:
其他好文 时间:
2014-07-18 14:35:09
阅读次数:
214
Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about th...
分类:
其他好文 时间:
2014-07-18 09:34:59
阅读次数:
212
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-07-18 00:32:24
阅读次数:
271
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-07-17 23:27:12
阅读次数:
216
Power NetworkTime Limit: 2000MSMemory Limit: 32768KTotal Submissions: 22517Accepted: 11800DescriptionA power network consists of nodes (power stations...
分类:
Web程序 时间:
2014-07-17 18:08:34
阅读次数:
415
很多人的解释都不一样, 我碰到的问题是,开辟的内存空间小于操作的内存空间.也就是说,我free的内存越界了.这是我开辟链表结构体内存的代码: 1 PNODE Create() { 2 int len; //total count of nodes to be created. 3 ...
分类:
移动开发 时间:
2014-07-17 09:57:34
阅读次数:
279
Given a singly linked listL: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 exam...
分类:
其他好文 时间:
2014-07-17 00:23:27
阅读次数:
215
var nodes = document.getElementsByTagName("script");var node = nodes[nodes.length - 1];var src = document.querySelector ? node.src : node.getAttribute...
分类:
编程语言 时间:
2014-07-16 17:07:50
阅读次数:
188
/*
调用方式:add(a, b);
返回类型:string
*/
string add(string a, string b)
{
string s;
reverse(a.begin(), a.end());
reverse(b.begin(), b.end());
int i = 0;
int m, k = 0;
while(a[i] && b...
分类:
其他好文 时间:
2014-07-16 08:04:51
阅读次数:
368