转自:http://blog.sina.com.cn/s/blog_53a5047b01018yqv.html例子结果atom_to_list(hello)."hello"list_to_atom("hello").hellobinary_to_list(>)."hello"binary_to_li...
分类:
其他好文 时间:
2015-04-11 17:47:29
阅读次数:
134
题目:
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of...
分类:
其他好文 时间:
2015-04-11 16:25:26
阅读次数:
127
Period of an Infinite Binary Expansion
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Submit Status Practice POJ
3358
Appoint description:
System Crawler (201...
分类:
其他好文 时间:
2015-04-11 13:18:57
阅读次数:
148
题目地址:https://leetcode.com/problems/balanced-binary-tree/题目解答:/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode ...
分类:
其他好文 时间:
2015-04-11 13:13:13
阅读次数:
100
题目:
Follow up for problem "Populating Next Right Pointers in Each Node".
What if the given tree could be any binary tree? Would your previous solution still work?
Note:
You may only us...
分类:
其他好文 时间:
2015-04-11 11:53:04
阅读次数:
192
从根节点开始按层次遍历一棵二叉树 思路:广搜即可 class Solution {public: vector > levelOrder(TreeNode *root) { vector > resVec; if (!root) return resVec; queue nodeQue; nodeQ...
分类:
其他好文 时间:
2015-04-11 11:44:38
阅读次数:
155
求一棵树的最大深度 思路:广度优先搜索即可 class Solution {public: int maxDepth(TreeNode *root) { int depth = 0; if (!root) return depth; queue nodeQue; nodeQue.push(root)...
分类:
其他好文 时间:
2015-04-11 11:38:05
阅读次数:
117
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For exam...
分类:
其他好文 时间:
2015-04-11 07:49:20
阅读次数:
107
题目:
Given a binary tree
struct TreeLinkNode {
TreeLinkNode *left;
TreeLinkNode *right;
TreeLinkNode *next;
}
Populate each next pointer to point to its next right n...
分类:
其他好文 时间:
2015-04-11 00:07:02
阅读次数:
170
Binary Search Tree Iterator
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
Calling next() will return the next smallest...
分类:
其他好文 时间:
2015-04-11 00:03:47
阅读次数:
200