码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcodeBinary 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: Recursi...
分类:其他好文   时间:2015-05-10 17:20:16    阅读次数:118
Path Sum -- leetcode
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. For example: Given the below binary tree and sum ...
分类:其他好文   时间:2015-05-10 17:19:39    阅读次数:92
分治习题--九章算法培训课第三章笔记
1.Maximum Depth of Binary Tree这是道简单的分治习题了分:左子树最大深度右子树最大深度治:最大深度等于max(左子树,右子树)+1public class Solution { public int maxDepth(TreeNode root) { ...
分类:编程语言   时间:2015-05-10 15:29:25    阅读次数:1098
leetcode-Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 return [1,2,3]. Note: Recursive soluti...
分类:其他好文   时间:2015-05-10 09:56:42    阅读次数:123
LeetCode 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 = 22, 5 / ...
分类:其他好文   时间:2015-05-10 09:43:32    阅读次数:103
Common Lisp学习笔记(八)
8 Recursion8.11 recursive templates8.12 variations on the basic templates8.13 trees and car/cdr recursion8.14 helping functions8 Recursion(defun fact ...
分类:其他好文   时间:2015-05-10 06:15:58    阅读次数:132
Leetcode#96Unique Binary Search Trees
UniqueBinarySearchTreesTotalAccepted:47684TotalSubmissions:131223MySubmissionsQuestionSolutionGivenn,howmanystructurallyuniqueBST‘s(binarysearchtrees)thatstorevalues1...n?Forexample,Givenn=3,thereareatotalof5uniqueBST‘s.13321 \///\321132 //\2123ShowTags..
分类:其他好文   时间:2015-05-09 20:36:17    阅读次数:93
[LeetCode 107] Binary Tree Level Order Traversal II
https://leetcode.com/problems/binary-tree-level-order-traversal-ii/ http://www.lintcode.com/zh-cn/problem/binary-tree-level-order-traversal-ii/# Given...
分类:其他好文   时间:2015-05-09 20:21:42    阅读次数:140
[LeetCode 102] Binary Tree Level Order Traversal
https://leetcode.com/problems/binary-tree-level-order-traversal/ http://www.lintcode.com/zh-cn/problem/binary-tree-level-order-traversal/# Given a bin...
分类:其他好文   时间:2015-05-09 18:52:00    阅读次数:93
C++二进制文件中读写bitset
这个比较简单,直接上代码:bitset *b = new bitset(255);bitset *c = new bitset(0);ofstream out("I:\\test.dat",ios::binary);out.write((char *)b,4);out.close();ifstrea...
分类:编程语言   时间:2015-05-09 16:26:35    阅读次数:137
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!