之前的git 知识是一星半点,经常commit 异常 ,所以这次记录下git相关知识。GIT对象模型每个对象都是 该'对象内容'SHA1(1种密码学的哈希算法) 以后的值,每个对象不可能一样(一样的情况是因为内容完全一致)每个对象含有以下3个内容:blob用来存储文件数据,通常是一个文件。tree ...
分类:
其他好文 时间:
2014-07-05 17:55:04
阅读次数:
153
1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNo...
分类:
其他好文 时间:
2014-07-05 16:53:34
阅读次数:
177
在计算机科学中,树是一种重要的非线性数据结构,直观地看,它是数据元素(在树中称为结点)按分支关系组织起来的结构。二叉树(Binary Tree)是每个节点最多有两个子树的有序树。通常子树被称作"左子树"(left subtree)和"右子树"(right subtree)。二叉树常被用于实现二叉查找树和二叉堆。值得注意的是,二叉树不是树的特殊情形。在图论中,二叉树是一个连通的无环图,并且每一个顶点的度不大于3。有根二叉树还要满足根结点的度不大于2。有了根结点后,每个顶点定义了唯一的根结点,和最多2个子结点。...
分类:
其他好文 时间:
2014-07-05 11:01:30
阅读次数:
267
Given a binary tree, determine if it is height-balanced.
分类:
其他好文 时间:
2014-07-03 19:00:17
阅读次数:
188
Given a binary tree, find its minimum depth.
分类:
其他好文 时间:
2014-07-03 18:54:32
阅读次数:
189
理解了Trie树然后就能1A 其实估计这个题随便做做就能A掉,可能不需要高级数据。
先贴吉林大学的代码模板
/*==================================================*| Trie树(k叉)
| INIT: init();
| 注: tree[i][tk]>0时表示单词存在, 当然也可赋予它更多含义;
\*=================...
分类:
其他好文 时间:
2014-07-03 13:42:21
阅读次数:
201
Given a binary tree, find its maximum depth.
分类:
其他好文 时间:
2014-07-03 13:19:33
阅读次数:
251
Given a binary tree, flatten it to a linked list in-place.
分类:
其他好文 时间:
2014-07-03 13:10:52
阅读次数:
204
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.
分类:
其他好文 时间:
2014-07-03 13:02:23
阅读次数:
200
如果说数组(Array)是以线性的方式存储数据,那么可以将二叉树(Binary Tree)想象成以非线性二维的方式存储数据。二叉查找树(BST : Binary Search Tree)规定了树节点排列的一些规则,以保证它的查找时间要低于数组的线性查找时间。BST 算法查找时间依赖于树的拓扑结构,最...
分类:
其他好文 时间:
2014-07-03 12:14:51
阅读次数:
253