码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Binary Tree Zigzag Level Traversal
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:其他好文   时间:2015-07-28 12:19:05    阅读次数:120
leetCode 95.Unique Binary Search Trees II (唯一二叉搜索树) 解题思路和方法
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example, Given n = 3, your program should return all 5 unique BST's shown below. 1 3...
分类:其他好文   时间:2015-07-28 10:52:02    阅读次数:199
leetCode 94.Binary Tree Inorder Traversal(二叉树中序遍历) 解题思路和方法
Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,3,2]. Note: Recursive solutio...
分类:其他好文   时间:2015-07-28 10:51:19    阅读次数:108
Binary Tree Level Order Traversal II
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:其他好文   时间:2015-07-28 00:25:01    阅读次数:112
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. 题目解析: 已知一个单链表,其中元素都是升序排列的,现在将链表转成平衡二叉树。 方法一: 我们用一个数组存储链表中元素,这样就可以利用下标访问元素,之后根据二分查找法找树的...
分类:其他好文   时间:2015-07-27 23:05:19    阅读次数:141
Binary Tree Level Order Traversal
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:其他好文   时间:2015-07-27 22:36:15    阅读次数:121
二叉树基本概念
Binary Tree? CLRS We define binary trees recursively. A binary tree T is a structure defined on a finite set of nodes that either contains no nodes, o...
分类:其他好文   时间:2015-07-27 20:51:58    阅读次数:209
LeetCode Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area.For example, given the following matrix:1 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 0 0 1 0 Return ...
分类:其他好文   时间:2015-07-27 19:12:53    阅读次数:106
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 the definition of LCA on Wikipedia: “The lowest common ancestor is defined betwee...
分类:其他好文   时间:2015-07-27 18:48:41    阅读次数:80
Binary Tree Postorder Traversal ***
Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[3,2,1].No...
分类:其他好文   时间:2015-07-27 18:35:11    阅读次数:98
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!