码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Binary Search Algorithm
二分查找代码://============================================================================// Name : BinarySearch.cpp// Author : Danny// Version...
分类:其他好文   时间:2015-05-24 06:29:07    阅读次数:188
Java for LeetCode 114 Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened ...
分类:编程语言   时间:2015-05-23 22:40:17    阅读次数:190
PAT Search in a Binary Search Tree
Search in a Binary Search TreeTo search a key in a binary search tree, we start from the root and move all the way down, choosing branches according t...
分类:其他好文   时间:2015-05-23 22:30:29    阅读次数:169
Java for LeetCode 112 Path Sum
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:编程语言   时间:2015-05-23 21:22:23    阅读次数:152
Java for LeetCode 110 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...
分类:编程语言   时间:2015-05-23 21:19:39    阅读次数:155
Java for LeetCode 111 Minimum Depth of Binary Tree
Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le...
分类:编程语言   时间:2015-05-23 21:16:50    阅读次数:170
Java for LeetCode 113 Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example:Given the below binary tree and sum ...
分类:编程语言   时间:2015-05-23 21:16:11    阅读次数:196
Java for LeetCode 109 Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:同上题,JAVA实现如下: public TreeNode sor...
分类:编程语言   时间:2015-05-23 21:13:59    阅读次数:145
Java for LeetCode 108 Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.解题思路:首先要理解,什么叫做height balanced BST,然后就十分容易了,JAVA实现如下:...
分类:编程语言   时间:2015-05-23 19:58:52    阅读次数:146
Java for LeetCode 107 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 ...
分类:编程语言   时间:2015-05-23 19:58:45    阅读次数:170
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!