码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Erlang中常用的类型转换[转]
转自: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
Leetcode: Gray Code
题目: 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
POJ 3358- Period of an Infinite Binary Expansion(欧拉函数+欧拉定理)
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
Leetcode Balanced Binary Tree
题目地址:https://leetcode.com/problems/balanced-binary-tree/题目解答:/** * Definition for binary tree * public class TreeNode { * int val; * TreeNode ...
分类:其他好文   时间:2015-04-11 13:13:13    阅读次数:100
Populating Next Right Pointers in Each Node II--LeetCode
题目: 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
Binary Tree Level Order Traversal
从根节点开始按层次遍历一棵二叉树 思路:广搜即可 class Solution {public: vector > levelOrder(TreeNode *root) { vector > resVec; if (!root) return resVec; queue nodeQue; nodeQ...
分类:其他好文   时间:2015-04-11 11:44:38    阅读次数:155
Maximum Depth of Binary Tree
求一棵树的最大深度 思路:广度优先搜索即可 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
Leetcode: Binary Tree Right Side View
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
Populating Next Right Pointers in Each Node--LeetCode
题目: 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
[LeetCode] Binary Search Tree Iterator
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!