码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
leetcode 101 Symmetric Tree
?? Symmetric Tree Total Accepted: 61440 Total Submissions: 194643 My Submissions                       Given a binary tree, check whether it is a mirror of itself (ie, symmetric ar...
分类:其他好文   时间:2015-07-10 00:29:44    阅读次数:157
LeetCode Same Tree (判断相同树)
题意:如题思路:递归解决,同判断对称树的原理差不多。先保证当前两个结点是相等的,再递归保证两左结点是相等的,再递归保证右结点是相等的。 1 /** 2 * Definition for a binary tree node. 3 * struct TreeNode { 4 * int ...
分类:其他好文   时间:2015-07-10 00:08:15    阅读次数:243
算法-二叉查找树
二叉查找树(Binary Search Tree),也称有序二叉树(ordered binary tree),排序二叉树(sorted binary tree),是指一棵空树或者具有下列性质的二叉树:1. 若任意节点的左子树不空,则左子树上所有结点的值均小于它的根结点的值;2. 若任意节点的右子树不...
分类:编程语言   时间:2015-07-10 00:07:29    阅读次数:230
Linux rpm 命令参数使用详解[
RPM是RedHatPackageManager(RedHat软件包管理工具)类似Windows里面的“添加/删除程序”rpm执行安装包二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作为后缀名。常用命令组合:..
分类:系统相关   时间:2015-07-09 22:49:11    阅读次数:317
LeetCode222 Count CompleteTree Nodes(计算完全二叉树的节点数) Java 题解
题目: Given a complete binary tree, count the number of nodes. Definition of a complete binary tree from Wikipedia: In a complete binary tree every level, except possibly the last, is completel...
分类:编程语言   时间:2015-07-09 22:42:58    阅读次数:266
[LintCode] Remove Node in Binary Search Tree
Remove Node in Binary Search TreeGiven a root of Binary Search Tree with unique value for each node. Remove the node with given value. If there is no ...
分类:其他好文   时间:2015-07-09 22:39:36    阅读次数:156
【LeetCode】222. Count Complete Tree Nodes
Count Complete Tree NodesGiven acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary...
分类:其他好文   时间:2015-07-09 19:33:00    阅读次数:92
LeetCode103 BinaryTreeZigzagLevelOrderTraversal(二叉树Z形层次遍历) Java题解
题目: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between). For example: Give...
分类:编程语言   时间:2015-07-09 17:59:13    阅读次数:112
leetcode-230-Kth Smallest Element in a BST
Kth Smallest Element in a BST   Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note:  You may assume k is always valid, 1 ≤ k ≤ BST's to...
分类:其他好文   时间:2015-07-09 14:40:05    阅读次数:122
【LeetCode 144_二叉树_遍历】Binary Tree Preorder Traversal
解法一:非递归 1 vector preorderTraversal(TreeNode* root) 2 { 3 vector res; 4 if (root == NULL) 5 return res; 6 7 stack node_stack; 8 ...
分类:其他好文   时间:2015-07-09 13:09:15    阅读次数:103
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!