码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
LintCode: Convert Sorted Array to Binary Search Tree With Minimal Height
C++/** * Definition of TreeNode: * class TreeNode { * public: * int val; * TreeNode *left, *right; * TreeNode(int val) { * this->v...
分类:其他好文   时间:2015-11-27 12:53:28    阅读次数:108
LintCode: Binary Tree Postorder Traversal
C++,递归 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode(int ...
分类:其他好文   时间:2015-11-27 00:53:23    阅读次数:248
230. Kth Smallest Element in a BST
题目:Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's t...
分类:其他好文   时间:2015-11-27 00:42:42    阅读次数:171
LintCode: Binary Tree Preorder Traversal
C++,递归 1 /** 2 * Definition of TreeNode: 3 * class TreeNode { 4 * public: 5 * int val; 6 * TreeNode *left, *right; 7 * TreeNode(int ...
分类:其他好文   时间:2015-11-27 00:39:53    阅读次数:271
LeetCode(144):Binary Tree Preorder Traversal
Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].Not...
分类:其他好文   时间:2015-11-26 22:43:47    阅读次数:181
天冷了,那些树还好吗?
二叉排序树(Binary Sort Tree)又称二叉查找树(Binary Search Tree)。AVL树:在计算机科学中,AVL树是最先发明的自平衡二叉查找树。在AVL树中任何节点的两个子树的高度最大差别为一,所以它也被称为高度平衡树。AVL树在节点增删后不再满足AVL树条件,则需要“旋转”以...
分类:其他好文   时间:2015-11-26 15:06:59    阅读次数:155
Add Binary
问题描述Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".算法代码一 1 public String addBinary(String a, S...
分类:其他好文   时间:2015-11-25 16:42:43    阅读次数:141
226. Invert Binary Tree
题目:Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired byt...
分类:其他好文   时间:2015-11-25 13:14:34    阅读次数:118
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 e...
分类:其他好文   时间:2015-11-25 11:33:08    阅读次数:129
222. Count Complete Tree Nodes
题目:Given acompletebinary tree, count the number of nodes.Definition of a complete binary tree fromWikipedia:In a complete binary tree every level, exc...
分类:其他好文   时间:2015-11-25 01:56:34    阅读次数:157
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!