
树
文章平均质量分 63
清溪浅水
这个作者很懒,什么都没留下…
展开
-
hdu——3791——二叉树搜索树
Problem Description判断两序列是否为同一二叉搜索树序列 Input开始一个数n,(1接下去一行是一个序列,序列长度小于10,包含(0~9)的数字,没有重复数字,根据这个序列可以构造出一颗二叉搜索树。接下去的n行有n个序列,每个序列格式跟第一个序列一样,请判断这两个序列是否能组成同一颗二叉搜索树。 Output如果序列相同则输出YES,否原创 2013-10-21 20:12:23 · 633 阅读 · 0 评论 -
hdu——1710——Binary Tree Traversals
Problem DescriptionA binary tree is a finite set of vertices that is either empty or consists of a root r and two disjoint binary trees called the left and right subtrees. There are three most impor原创 2013-10-22 21:14:57 · 578 阅读 · 0 评论 -
二叉树遍历算法
一.创建二叉树struct BiTreeNode{ int c; struct BiTreeNode *left; struct BiTreeNode *right;}; 二.二叉树三种递归遍历//先序遍历--递归 int traverseBiTreePreOrder(BiTreeNode *ptree,int (*visit)(int)) {原创 2013-10-23 20:50:32 · 707 阅读 · 0 评论 -
poj——2255——Tree Recovery
DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes. This is an example of o原创 2014-03-18 16:00:17 · 472 阅读 · 0 评论 -
poj——1679——The Unique MST(树+dp)
DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G原创 2014-03-19 22:47:22 · 548 阅读 · 0 评论 -
曼哈顿距离和欧氏距离比较
曼哈顿距离是由十九世纪的赫尔曼·闵可夫斯基所创词汇 ,是种使用在几何度量空间的几何学用语,用以标明两个点在标准坐标系上的绝对轴距总和。出租车几何或曼哈顿距离(Manhattan Distance)是由十九世纪的赫尔曼·闵可夫斯基所创词汇 ,是种使用在几何度量空间的几何学用语,用以标明两个点在标准坐标系上的绝对轴距总和。图中红线代表曼哈顿距离,绿色代表欧氏距离,也就是直线距离,而蓝色原创 2014-03-24 11:16:01 · 9140 阅读 · 1 评论 -
poj——1985——Cow Marathon
DescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The maratho原创 2014-03-24 12:21:51 · 552 阅读 · 0 评论