码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
[LeetCode] Binary Tree Postorder Traversal
This is a fundamental and yet classic problem. I share my three solutions here:Iterative solution using stack ---O(n)time andO(n)space;Recursive solut...
分类:其他好文   时间:2015-06-03 00:54:17    阅读次数:101
[LeetCode] Binary Tree Zigzag Level Order Traversal
To be honest, this problem is designed to let you use stacks. However, I don't. In fact, you only need to keep a flagand switch it between falseandtru...
分类:其他好文   时间:2015-06-03 00:49:58    阅读次数:232
[LeetCode] Binary Tree Inorder Traversal
This is a fundamental and yet classic problem. I share my three solutions here:Iterative solution using stack ---O(n)time andO(n)space;Recursive solut...
分类:其他好文   时间:2015-06-03 00:49:25    阅读次数:132
[LeetCode] Binary Tree Preorder Traversal
This is a fundamental and yet classic problem. I share my three solutions here:Iterative solution using stack ---O(n)time andO(n)space;Recursive solut...
分类:其他好文   时间:2015-06-03 00:46:35    阅读次数:131
[LeetCode] Binary Tree Level Order Traversal II
Well, I do not see what this problem is for. The same code of Binary Tree Level Order Traversal can be used here. The only difference is that we shoul...
分类:其他好文   时间:2015-06-03 00:44:08    阅读次数:209
[LeetCode] Flatten Binary Tree to Linked List
This problem seems to be tricky at first glance. However, if you know Morris traversal, it is just the preorder case of Morris traversal and the code ...
分类:其他好文   时间:2015-06-03 00:42:17    阅读次数:136
[LeetCode] Binary Tree Level Order Traversal
A classic tree traversal problem. I share my two solutions here: BFS and DFS.BFS: 1 vector> levelOrder(TreeNode *root) { 2 vector> levels;...
分类:其他好文   时间:2015-06-03 00:36:39    阅读次数:161
leetcode_Number of 1 Bits_easy
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 00000000...
分类:其他好文   时间:2015-06-02 22:04:54    阅读次数:128
leetcode_Reverse Bits_easy
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as0011100101...
分类:其他好文   时间:2015-06-02 22:04:40    阅读次数:166
B-tree/B+tree/B*tree [转]
动态查找树主要有:二叉查找树(Binary Search Tree),平衡二叉查找树(Balanced Binary Search Tree),红黑树 (Red-Black Tree ),B-tree/B+-tree/ B*-tree (B~Tree)。前三者是典型的二叉查找树结构,其查找的时间复杂...
分类:其他好文   时间:2015-06-02 19:44:10    阅读次数:249
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!