码迷,mamicode.com
首页 >  
搜索关键字:swap nodes in pairs    ( 8848个结果
lua学习笔记(九)
环境全局变量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
Binary Tree Level Order Traversal II
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
Lowest Common Ancestor of a Binary Tree
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
Lowest Common Ancestor of a Binary Tree, with Parent Pointer
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
Lowest Common Ancestor of a Binary Search Tree (BST)
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
Binary Tree Level Order Traversal
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
Same Tree
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
Binary Tree Level Order Traversal II
本文是在学习中的总结,欢迎转载但请注明出处: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
Maximum Depth of Binary Tree
本文是在学习中的总结,欢迎转载但请注明出处: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
Solve equation
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!