码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Leetcode-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 an...
分类:其他好文   时间:2014-11-09 06:16:58    阅读次数:170
Leetcode-Construct Binary Tree from inorder and postorder travesal
Given inorder and postorder traversal of a tree, construct the binary tree.Solution: 1 /** 2 * Definition for binary tree 3 * public class TreeNode .....
分类:其他好文   时间:2014-11-09 06:16:44    阅读次数:215
Leetcode-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 ...
分类:其他好文   时间:2014-11-09 06:13:51    阅读次数:122
leetcode Add Binary
题目:给定两个二进制字符串,返回相加的结果,也是二进制表示。主要就是考查进位如何操作,以及最后如果加完之后进位还是1的话那么不能漏了还要加1.跟之前有做过一题的类似。因为这题easy就是判断,所以直接贴代码了,感觉好长的样子。class Solution {public: string add...
分类:其他好文   时间:2014-11-09 00:58:42    阅读次数:130
Leetcode-Convert Sorted Array to BST
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.Solution: 1 /** 2 * Definition for binary tree 3 * .....
分类:其他好文   时间:2014-11-09 00:58:31    阅读次数:213
Leetcode-Balanced Binary Tree
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:其他好文   时间:2014-11-09 00:55:08    阅读次数:250
Binary Tree Preorder Traversal
Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:其他好文   时间:2014-11-08 23:36:00    阅读次数:202
c#使用数组实现二叉查找树
原创性申明: 本文地址是 http://blog.csdn.net/zhujunxxxxx/article/details/40658925 转载请注明出处。作者联系邮箱 zhujunxxxxx@163.com 二叉排序树 (Binary Sort Tree)又称二叉查找树(Binary Search Tree),亦称二叉搜索树。 它或者是一棵空树;或者是具有下列性质的二叉树: (1)若...
分类:编程语言   时间:2014-11-08 22:15:05    阅读次数:211
LeetCode Path Sum 判断树的路径之和
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode *left; 6 * TreeNode *right; 7 * TreeNode(i...
分类:其他好文   时间:2014-11-08 21:58:27    阅读次数:179
【LeetCode】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 2 / 3 return [1,3,2]. Note: Recursive solution is trivial, could you do it iteratively?...
分类:其他好文   时间:2014-11-08 19:43:46    阅读次数:188
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!