Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:
其他好文 时间:
2014-10-19 22:42:10
阅读次数:
223
1 /** 2 * Definition for binary tree 3 * public class TreeNode { 4 * int val; 5 * TreeNode left; 6 * TreeNode right; 7 * TreeNo...
分类:
其他好文 时间:
2014-10-19 21:11:49
阅读次数:
189
Kd-树 其实是K-dimension tree的缩写,是对数据点在k维空间中划分的一种数据结构。其实,Kd-树是一种平衡二叉树。举一示例:假设有六个二维数据点 = {(2,3),(5,4),(9,6),(4,7),(8,1),(7,2)},数据点位于二维空间中。为了能有效的找到最近邻,Kd-树采用...
分类:
其他好文 时间:
2014-10-19 18:18:57
阅读次数:
370
#include
#include
#include
#include
typedef struct AVLTree{
char name[31];
int nCount;
int nHeight;
struct AVLTree* pLeft;
struct AVLTree* pRight;
}AVLTree;
int Max( int...
分类:
其他好文 时间:
2014-10-19 17:09:29
阅读次数:
243
昨天学习完了Ng的第二课,总结如下:过拟合;欠拟合;参数学习算法;非参数学习算法局部加权回归KD tree最小二乘中心极限定律感知器算法sigmod函数梯度下降/梯度上升二元分类logistic回归
分类:
其他好文 时间:
2014-10-19 17:03:42
阅读次数:
302
(一)基本概念: ??? 1、二进制型: 二进制的原始数据 ??? 2、Erlang虚拟机对二进制型的输入、输出和消息传递都做了优化,十分高效。 ??? 3、二进制型里的位数如果是8的倍数,则称为二进制型(binary) ??...
分类:
其他好文 时间:
2014-10-19 15:44:19
阅读次数:
457
D Tree
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 102400/102400 K (Java/Others)
Total Submission(s): 1687 Accepted Submission(s): 263
Problem Description
There is a skyscrapin...
分类:
其他好文 时间:
2014-10-19 15:43:05
阅读次数:
207
Problem Description
在图论中,树:任意两个顶点间有且只有一条路径的图。
生成树:包含了图中所有顶点的一种树。
最小生成树:对于连通的带权图(连通网)G,其生成树也是带权的。生成树T各边的权值总和称为该树的权,权最小的生成树称为G的最小生成树(Minimum Spanning Tree)。最小生成树可简记为MST。
但是,对于一个图而言,最小生成树并不是唯一的。
现...
分类:
其他好文 时间:
2014-10-19 11:36:48
阅读次数:
131
1、类中递归调用添加self;2、root为None,返回03、root不为None,root左右孩子为None,返回14、返回l和r最小深度,l和r初始为极大值; 1 # Definition for a binary tree node 2 # class TreeNode: 3 # ...
分类:
编程语言 时间:
2014-10-19 10:13:07
阅读次数:
222
1、类中递归调用函数需要加self# Definition for a binary tree node# class TreeNode:# def __init__(self, x):# self.val = x# self.left = None# ...
分类:
编程语言 时间:
2014-10-19 10:11:52
阅读次数:
200