package prac_1;
/**
* Title: 树参数
* Description: 使用继承类,柳树就是树
* Copyright: Copyright (c) 2014
* Filename:
* @author 王海涛
* @version 0.1
*/
class tree
{
/**
*方法说明:树的树根
*输入参数:
*返回类型:
*/
publ...
分类:
编程语言 时间:
2014-09-26 12:34:48
阅读次数:
210
主要的思想类似中序遍历,先构建左子树,再构建当前节点,并构建右子树
TreeNode *sortedListToBST(ListNode *head) {
int count = 0;
ListNode * cur = head;
while (cur)
{
count++;
cu...
分类:
其他好文 时间:
2014-09-26 11:41:08
阅读次数:
230
今晚CF GYM A题,神坑。。原题:Aspen Avenue``Phew, that was the last one!'' exclaimed the garden helper Tim as he threw the last tree plant to the ground. His emp...
分类:
Web程序 时间:
2014-09-26 02:22:08
阅读次数:
320
因为set/map/multiset/multimap都是基于RB-tree之上,所以有自动排序功能,而hash_set/hash_map/hash_multiset/hash_multimap都是基于hashtable之上,所以不含有自动排序功能,至于加个前缀multi_无非就是允许键值重复而已。...
分类:
其他好文 时间:
2014-09-26 01:44:28
阅读次数:
297
UtopianTree#include<iostream>
usingnamespacestd;
intheight(intn){
if(n==0)
return1;
else
{
if(n%2==0)
returnheight(n-1)+1;
else
returnheight(n-1)*2;
}
return0;
}
intmain(){
intT;
cin>>T;
while(T--){
intn;
cin>>n;
cout<<height(n)&l..
分类:
其他好文 时间:
2014-09-26 00:40:08
阅读次数:
188
题意:给出一颗树,求出两个点的距离小于K的点对的个数.sL : 树的点分治,代码中有解释。1#include2#include3#include4#include5#include6#include7usingnamespacestd;8typedeflonglongLL;9constintMAX=...
分类:
其他好文 时间:
2014-09-25 22:43:27
阅读次数:
254
一:平衡二叉树特点:平衡二叉树(Balanced binary tree)是由阿德尔森-维尔斯和兰迪斯(Adelson-Velskii and Landis)于1962年首先提出的,所以又称为AVL树。定义:平衡二叉树或为空树,或为如下性质的二叉排序树: (1)左右子树深度之差的绝对值不超过1; (...
分类:
其他好文 时间:
2014-09-25 22:12:17
阅读次数:
284
本文讲解的是C#编程结构和算法之树。
首先,在win下,进入命令行,输入tree,它会以树的形式返回当前文件夹下的所有子文件夹及文件。
分类:
其他好文 时间:
2014-09-25 21:19:27
阅读次数:
182
http{limit_conn_zone$binary_remote_addrzone=conn:10m;server{location/{limit_connconn2;}}}limit_conn_zone用在http段。limit_conn可以用在http,server,location区段。nginx新语法limit_conn_zone替换limit_conn用法对应conf文件夹中的nginx.conf文件,将limit_conn替换..
分类:
其他好文 时间:
2014-09-25 17:11:59
阅读次数:
236