码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
LeetCode104_MaximumDepthofBinaryTree Java题解
题目: 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 farthe ...
分类:编程语言   时间:2017-06-08 19:44:11    阅读次数:110
404. Sum of Left Leaves
https://leetcode.com/problems/sum-of-left-leaves/#/description Find the sum of all left leaves in a given binary tree. Example: Hint: Q: How to define ...
分类:其他好文   时间:2017-06-08 18:56:42    阅读次数:176
二分查找
Binary-Search二分查找又称折半查找,用于不经常变动而查找频繁的有序列表,查询速度快。1、首先需要对列表进行升序排列2、将列表中的关键字与查找关键字比较,如果相等则查找成功。否则将列表从中间分成两部分,如果中间记录关键字大于查找关键字,则往中间关键字左边查找,否..
分类:其他好文   时间:2017-06-08 18:03:42    阅读次数:149
[Leetcode] Construct binary tree from inorder and postorder travesal 利用中序和后续遍历构造二叉树
Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 利用中序和后序遍历构造 ...
分类:其他好文   时间:2017-06-08 17:56:09    阅读次数:235
Convert Sorted List to Binary Search Tree
https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/#/description 跟数组那题没有什么本质区别,唯一的障碍是,在数组里因为长度已知,所以求中位数很方便。但是链表里找中位数就麻烦一点了。 快慢指针再 ...
分类:其他好文   时间:2017-06-08 16:36:28    阅读次数:168
Unique Binary Search Trees II -- LeetCode
原题链接: http://oj.leetcode.com/problems/unique-binary-search-trees-ii/ 这道题是求解全部可行的二叉查找树,从Unique Binary Search Trees中我们已经知道,可行的二叉查找树的数量是对应的卡特兰数,不是一个多项式时间 ...
分类:其他好文   时间:2017-06-08 13:12:29    阅读次数:149
[Leetcode] Binary search--300. Longest Increasing Subsequence
Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc ...
分类:其他好文   时间:2017-06-08 13:09:04    阅读次数:205
Binary search tree or not
https://github.com/Premiumlab/Python-for-Algorithms--Data-Structures--and-Interviews/blob/master/Mock%20Interviews/Ride%20Share%20Start-Up%20Company/R ...
分类:其他好文   时间:2017-06-08 10:48:27    阅读次数:236
JAVA随笔篇一(Timer源代码分析和scheduleAtFixedRate的使用)
写完了基础篇,想了非常久要不要去写进阶篇。去写JSP等等的用法。最后决定先不去写。由于自己并非JAVA方面的大牛。眼下也在边做边学,所以决定先将自己不懂的拿出来学并记下来。 Timer是Java自带的java.util.Timer类,通过调度一个java.util.TimerTask任务。这样的方式 ...
分类:编程语言   时间:2017-06-08 10:41:12    阅读次数:256
572. 是否为另一棵二叉树的子树 Subtree of Another Tree
Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a... ...
分类:其他好文   时间:2017-06-08 01:27:34    阅读次数:263
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!