Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:
其他好文 时间:
2015-03-12 16:45:35
阅读次数:
117
题目:Reverse BitsReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010...
分类:
其他好文 时间:
2015-03-12 14:57:14
阅读次数:
125
Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 / 3return [1,2,3]...
分类:
其他好文 时间:
2015-03-12 12:48:57
阅读次数:
95
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-03-12 11:34:16
阅读次数:
112
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110010...
分类:
其他好文 时间:
2015-03-12 11:29:01
阅读次数:
120
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
114 Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ 2 5
...
分类:
其他好文 时间:
2015-03-12 09:55:58
阅读次数:
110
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
107 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 ...
分类:
其他好文 时间:
2015-03-12 09:55:46
阅读次数:
117
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
102 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 exam...
分类:
其他好文 时间:
2015-03-12 09:55:01
阅读次数:
128
欢迎大家阅读参考,如有错误或疑问请留言纠正,谢谢
94 Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
\...
分类:
其他好文 时间:
2015-03-12 09:54:04
阅读次数:
121
Given the root and two nodes in a Binary Tree. Find the lowest common ancestor(LCA) of the two nodes.The lowest common ancestor is the node with large...
分类:
其他好文 时间:
2015-03-12 06:25:09
阅读次数:
117