码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
centos安装wget 及配置(转)
yum -y install wget#yum install perlSearching for GCC...The path "" is not valid path to the gcc binary.Would you like to change it? [yes]如果出现这个就表明gcc...
分类:其他好文   时间:2015-12-26 18:28:10    阅读次数:13771
[LeetCode] 35. Search Insert Position 解决思路
问题:给定一个已排序数组和一个整数,若整数已在数组中则返回在数组中的下标,否则返回应当插入的位置。 对一个已排序数组进行搜索,很自然地会想到二分搜索(Binary Search),毕竟是经典场景。这道题也确实是二分搜索的一个简单应用。 之所以记录这道题目,是感觉二分搜索和之前做的 双指针法 tw...
分类:其他好文   时间:2015-12-26 13:25:26    阅读次数:143
[LeetCode]113. Maximum Depth of Binary Tree二叉树的最大深度
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:其他好文   时间:2015-12-25 20:59:38    阅读次数:167
Java [Leetcode 235]Lowest Common Ancestor of a Binary Search Tree
题目描述:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipe...
分类:编程语言   时间:2015-12-25 18:43:50    阅读次数:140
LeetCode() Binary Tree Level Order Traversal
感觉我这个思路好 先记录上一层有几个节点/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * Tre...
分类:其他好文   时间:2015-12-25 14:56:34    阅读次数:125
Invert a binary tree 翻转一棵二叉树
Invert a binary tree 翻转一棵二叉树假设有如下一棵二叉树: 4 / \ 2 7 / \ / \1 3 6 9翻转后: 4 / \ 7 2 / \ / \ 9 6 3 1这里采用递归的方法来处理。遍历结点,将每个结点的两个子结点交换位置即...
分类:其他好文   时间:2015-12-25 01:07:11    阅读次数:150
Leetcode: Closest Binary Search Tree Value II
Given a non-empty binary search tree and a target value, find k values in the BST that are closest to the target.Note:Given target value is a floating...
分类:其他好文   时间:2015-12-24 14:38:10    阅读次数:174
Leetcode: Closest Binary Search Tree Value
Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target.Note:Given target value is a floating...
分类:其他好文   时间:2015-12-24 10:30:24    阅读次数:128
199. Binary Tree Right Side View
根据 arraylist 的size和level比较, 从而每层bst只放一个元素public class Solution { public List rightSideView(TreeNode root) { List res = new ArrayList(); ...
分类:其他好文   时间:2015-12-24 07:04:09    阅读次数:190
HDU 3999 二叉排序树
The order of a TreeProblem DescriptionThe shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:1.insert a ...
分类:编程语言   时间:2015-12-23 21:01:44    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!