检索模型分为两种,一种是boolean model 一种是ranked retrieval一 boolean查找:1 binary decision:is document relevant or not? 文档只有相关和不相关两种,并没有排行2 presence of term is necess...
分类:
其他好文 时间:
2014-12-21 08:08:27
阅读次数:
187
先简单介绍下先序遍历、中序遍历和后序遍历,先序遍历为ABC,中序遍历为BAC,后续遍历为BCA,根节点在的位置决定了什么遍历。该题的递归解法:class Solution {public: typedef TreeNode * STreeNode; vector buf; vector pos...
分类:
其他好文 时间:
2014-12-20 19:36:13
阅读次数:
178
《30天自制操作系统》作者:川合秀实原著作者的官网:http://community.osdev.info/Bz1.62的下载地址:http://pan.baidu.com/s/1gdjCaOV 万事开头难,不知道从哪个地方开始。就从用到的第一个软件开始吧——Bz1.62(Binary Edito....
分类:
其他好文 时间:
2014-12-20 19:35:05
阅读次数:
219
cmake的使用重点是写CMakeLists.txt文档,比如一个Hello word.cpp利用cmake 的执行方法是1.写CMakeLists.txt文档1)PROJECT(Hello word) #建立一个工程,类似于VS中的windows控制工程,这一行建立两个变量HELLO_BINARY...
分类:
其他好文 时间:
2014-12-20 18:07:05
阅读次数:
138
题目
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
解答
求二叉树的最大深度。
递归:a.若二叉树为空,...
分类:
其他好文 时间:
2014-12-20 15:38:37
阅读次数:
173
03-3. Tree Traversals Again (25)
时间限制
200 ms
内存限制
65536 kB
代码长度限制
8000 B
判题程序
Standard
作者
CHEN, Yue
An inorder binary tree traversal can ...
分类:
其他好文 时间:
2014-12-20 14:19:10
阅读次数:
150
这道题一共有三道解法:其中第二种解法,我参考了迭代器的写法,写了一个迭代器的类。重载了前++和—>操作符,但是这个解法会造成内存的超限,很奇怪,解法1:递归解法: 1 class Solution { 2 public: 3 vector result; 4 vector preor...
分类:
其他好文 时间:
2014-12-20 12:57:22
阅读次数:
198
map mapIndex;void mapToIndex(int inorder[], int n){ for (int i = 0; i ::value_type(inorder[i], i); }}Node* buildInorderPreorder(int in[], int pr...
分类:
其他好文 时间:
2014-12-20 11:40:02
阅读次数:
118
One TopCoder article introduces a very interesting alternative solution to Longest Common Sequences problem.It is based on this statement (http://comm...
分类:
其他好文 时间:
2014-12-20 10:26:37
阅读次数:
240
class Solution {public: int maxPathSum(TreeNode *root) { if(root == NULL) return 0; int max_sum = INT_MIN; unordered_map node_...
分类:
其他好文 时间:
2014-12-19 21:53:01
阅读次数:
201