码迷,mamicode.com
首页 >  
搜索关键字:hdoj tree    ( 20544个结果
Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.思路:由前序遍历数组和中序遍历...
分类:其他好文   时间:2014-04-30 02:20:33    阅读次数:366
【HDOJ】1978 How many ways
DFS。 1 #include 2 #include 3 4 #define MAXNUM 105 5 6 int map[MAXNUM][MAXNUM], ways[MAXNUM][MAXNUM], n, m; 7 8 int dfs(int x, int y) { 9 int ...
分类:其他好文   时间:2014-04-29 23:21:58    阅读次数:383
Binary Tree Postorder Traversal
借助堆栈完成迭代形式的后序遍历
分类:其他好文   时间:2014-04-29 19:22:59    阅读次数:404
Binary Tree Preorder Traversal
借助堆栈完成迭代形式的先序遍历。
分类:其他好文   时间:2014-04-29 19:03:25    阅读次数:474
中科院随机算法课程(孙晓明主讲)topic list
如题,列出《随机算法》课程的topic list,以记录和供有兴趣的朋友研究。Lession1:生日悖论、生日攻击、两个常用数学工具(马尔科夫不等式、切比雪夫不等式)Lession2:radom quick sort(hw)、矩阵乘法判定、min(max())=max(min())、复杂性类(BPP...
分类:其他好文   时间:2014-04-29 16:16:55    阅读次数:596
《Cracking the Coding Interview》——第17章:普通题——题目13
2014-04-29 00:15题目:将二叉搜索树展开成一个双向链表,要求这个链表仍是有序的,而且不能另外分配对象,就地完成。解法:Leetcode上也有,递归解法。代码: 1 // 17.13 Flatten a binary search tree into a doubly linked li...
分类:其他好文   时间:2014-04-29 14:51:49    阅读次数:460
【HDOJ】2157 How many ways??
矩阵乘法,用DP做各种wa,后来发现原因了。 1 #include 2 #include 3 4 typedef struct { 5 int map[20][20]; 6 } matrix_st; 7 8 matrix_st res, org; 9 int n, m;10 11 m...
分类:其他好文   时间:2014-04-29 11:26:46    阅读次数:418
【HDOJ】1753 大明A+B
注意数据格式,可以是整数,并且注意输出最简化浮点数。 1 #include 2 #include 3 4 #define MAXNUM 420 5 6 char a[MAXNUM], b[MAXNUM], c[MAXNUM], d[MAXNUM]; 7 int lena, le...
分类:其他好文   时间:2014-04-28 14:14:34    阅读次数:335
whatweb tree
.├── 1.txt├── addons│ ├── country-scanner│ ├── gggooglescan│ ├── hunter│ └── verify-nikto├── CHANGELOG├── INSTALL├── lib│ ├── colour.rb│ ├── extend-ht...
分类:Web程序   时间:2014-04-28 14:10:38    阅读次数:4375
leetcode day4 -- Binary Tree Postorder(Preorder) Traversal && Edit Distance
?? 1、Binary Tree Postorder Traversal Given a binary tree, return the postorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 2 / 3 retu...
分类:其他好文   时间:2014-04-27 18:58:59    阅读次数:481
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!