码迷,mamicode.com
首页 >  
搜索关键字:binary tree    ( 23211个结果
[leetcode]Binary Tree Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal/题意:二叉树的层序遍历的实现。解题思路:二叉树的层序遍历可以用bfs或者dfs来实现。这里使用的dfs实现,代码比较简洁。实际上,二叉树的先序遍历就是dfs实...
分类:编程语言   时间:2014-05-14 03:25:59    阅读次数:428
Codeforces Round #245 (Div. 1)——Xor-tree
给一棵树n个节点,1为根节点。操作为,选定一个节点x,当前值取反,x的孙子,孙子的孙子。。。均取反 现在告诉初始时每个点的值和最后每个点的目标值,求操作次数最少时需要选择那些节点...
分类:其他好文   时间:2014-05-14 01:20:50    阅读次数:367
Leetcode 树 Symmetric Tree
本文为senlie原创,转载请保留此地址:http://blog.csdn.net/zhengsenlie Symmetric Tree  Total Accepted: 13991 Total Submissions: 44240 Given a binary tree, check whether it is a mirror of itself ...
分类:其他好文   时间:2014-05-14 00:52:07    阅读次数:372
[leetcode]Binary Tree Level Order Traversal II @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-level-order-traversal-ii/题意:Given a binary tree, return thebottom-up level ordertraversal of its node...
分类:编程语言   时间:2014-05-12 22:03:27    阅读次数:581
[leetcode]Binary Tree Zigzag Level Order Traversal @ Python
原题地址:http://oj.leetcode.com/problems/binary-tree-zigzag-level-order-traversal/题意:Given a binary tree, return thezigzag level ordertraversal of its nod...
分类:编程语言   时间:2014-05-12 22:02:26    阅读次数:480
[leetcode]Minimum Depth of Binary Tree @ Python
原题地址:http://oj.leetcode.com/problems/minimum-depth-of-binary-tree/题意:Given a binary tree, find its minimum depth.The minimum depth is the number of no...
分类:编程语言   时间:2014-05-12 21:55:15    阅读次数:348
boost::archive::binary_iarchive
#include #include #include #include #include #include #include #include #include #include using namespace std;struct MyStruct{ string stru; int ...
分类:其他好文   时间:2014-05-12 21:51:09    阅读次数:572
[leetcode]Convert Sorted Array to Binary Search Tree @ Python
原题地址:http://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/题意:将一个排序好的数组转换为一颗二叉查找树,这颗二叉查找树要求是平衡的。解题思路:由于要求二叉查找树是平衡的。所以我们可以选在数组的中间那...
分类:编程语言   时间:2014-05-12 21:44:57    阅读次数:379
[leetcode]Convert Sorted List to Binary Search Tree @ Python
原题地址:http://oj.leetcode.com/problems/convert-sorted-list-to-binary-search-tree/题意:将一条排序好的链表转换为二叉查找树,二叉查找树需要平衡。解题思路:两个思路:一,可以使用快慢指针来找到中间的那个节点,然后将这个节点作为...
分类:编程语言   时间:2014-05-12 21:07:00    阅读次数:405
mongodb文档支持的数据类型
1. 存储类型 mongodb文档类似于json,但不是完全的json。 json只有六种类型:null, bool, 数字,字符串,数组,对象。 但是mongo的文档在json的基础上还扩展了几种类型, 比如,日期类型,整数,浮点数。 mongodb真正存储在磁盘上是使用bson(binary json)。...
分类:数据库   时间:2014-05-11 20:28:51    阅读次数:442
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!