码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node....
分类:其他好文   时间:2015-03-30 11:18:59    阅读次数:108
LeetCode: Path Sum II 解题报告
Path Sum IIGiven 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 tr...
分类:其他好文   时间:2015-03-30 10:52:04    阅读次数:158
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 t...
分类:其他好文   时间:2015-03-30 10:52:04    阅读次数:106
Leetcode:Populating Next Right Pointers in Each Node
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. ...
分类:其他好文   时间:2015-03-30 09:38:00    阅读次数:163
Unique Binary Search Tree -- LeetCode
题目: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 ...
分类:其他好文   时间:2015-03-29 15:11:19    阅读次数:106
leetcode_99_Recover Binary Search Tree
思路: 首先中序遍历二叉查找树并将遍历的节点存储到一个list中,然后对list中的值进行比较,查找出位置出现变化的两个结点,将两个结点的值进行互换,完成本题的要求。 但是呢,对于如何发现位置出现变化的两个结点是本题的重点和难点,具体判断条件可以参见下面的程序,最后对查到的结点进行取舍也是一大问题,一般符合判断条件的结点会出现三个,我取的是第一个和第三个,这不好讲清楚,具体可自行推敲。...
分类:其他好文   时间:2015-03-29 12:20:09    阅读次数:148
Flatten Binary Tree to Linked List
Flatten Binary Tree to Linked List问题:Given a binary tree, flatten it to a linked list in-place.思路: 前序pre-order遍历+prenode我的代码:public class Solution { ....
分类:其他好文   时间:2015-03-29 12:05:49    阅读次数:104
C++ primer plus random.cpp
1 // random.cpp -- random access to a binary file 2 #include // not required by most systems 3 #include 4 #include 5 #include // (o...
分类:编程语言   时间:2015-03-29 09:24:23    阅读次数:159
109【LeetCode】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. {CSDN:CODE:630443}...
分类:其他好文   时间:2015-03-29 07:08:21    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!