环境全局变量table lua把所有的全局变量存在一个table里,并把这个table赋值给一个全局变量_G _G也在这个全局变量的table里,它就是一个普通的全局变量 可以用这种方法遍历所有全局变量 for k, v in pairs(_G) do print(k,v) end 可以使用...
分类:
其他好文 时间:
2014-12-17 15:55:54
阅读次数:
208
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root).
For example:
Given binary tree {3,9,20,#,#,15,7},
...
分类:
其他好文 时间:
2014-12-17 09:50:15
阅读次数:
169
Given a binary tree, find the lowest common ancestor of two given nodes in the tree.Node* LCA(Node* root, Node* p, Node* q){ if (root == NULL || p ...
分类:
其他好文 时间:
2014-12-17 01:35:37
阅读次数:
124
Given a binary tree, find the lowest common ancestor of two given nodes in tree. Each node contains a parent pointer which links to its parent.int get...
分类:
其他好文 时间:
2014-12-17 01:28:42
阅读次数:
152
Given a binary search tree(BST), find the lowest common ancestor of two given nodes in the BST.Node* LCA(Node* root, Node* p, Node* q){ if (!root |...
分类:
其他好文 时间:
2014-12-17 00:13:50
阅读次数:
172
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ 9 20
/ ...
分类:
其他好文 时间:
2014-12-16 22:46:46
阅读次数:
223
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
#include
#...
分类:
其他好文 时间:
2014-12-16 21:08:09
阅读次数:
189
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41964067
Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root)....
分类:
其他好文 时间:
2014-12-16 21:07:59
阅读次数:
207
本文是在学习中的总结,欢迎转载但请注明出处:http://blog.csdn.net/pistolove/article/details/41964475
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 leaf node....
分类:
其他好文 时间:
2014-12-16 21:07:51
阅读次数:
197
Description
You are given two positive integers A and B in Base C. For the equation:
A=k*B+d
We know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now...
分类:
其他好文 时间:
2014-12-16 21:05:09
阅读次数:
244