HDU 2489 Minimal Ratio Tree(数据结构-最小生成树)
题目大意:
给你一张图n个点,每个点有权值,问你选出m个点,使得最小,输出方案。
解题思路:
用取与不取来枚举选出m个点的方案,既然m个点选定了,那么分母就确定了,分子通过最小生成树算出最小。...
分类:
其他好文 时间:
2014-08-01 16:08:11
阅读次数:
280
declare @spid int;declare @sql_handle binary(20);set @spid = 437SELECT @sql_handle = sql_handleFROM sysprocesses As A with (nolock)where spid = @spids...
分类:
数据库 时间:
2014-08-01 16:00:41
阅读次数:
1086
Installationsteps->useraddmysql->cd/tmp;tar-xzfmysql-VERSION-OS.tar.gz-C/usr/local->cd/usr/local;mvmysql-VERSION-OSmysql->chown-Rroot.rootmysql->mkdir-p/data/db/mysql/3306->chownmysql.mysql/data/db/mysql/3306->cd/usr/local/mysql->scr..
分类:
数据库 时间:
2014-08-01 13:54:41
阅读次数:
271
问题描述:
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
解题思路:...
分类:
其他好文 时间:
2014-08-01 13:48:11
阅读次数:
183
该代码实现了tree的结构,依赖dyArray数据结构。有first一级目录,second二级目录。
dyArray的c实现参考这里点击打开链接 hashTable的c实现参考这里点击打开链接
下面是跨平台的数据类型定义
//
// cpPlatform.h
// dataStruct
//
// Created by hherima on 14-7-29.
// Copyrigh...
分类:
编程语言 时间:
2014-08-01 13:46:21
阅读次数:
279
为了提高查找效率,这里将敏感词用树形结构存储,每个节点有一个map成员,其映射关系为一个string对应一个TreeNode。STL::map是按照operator 2 #include 3 //#include 4 using namespace std; 5 6 7 class Tree...
分类:
编程语言 时间:
2014-08-01 13:31:41
阅读次数:
486
POJ 2828题目大意是说有n个插入操作,每次把B插入到位置A,原来A以后的全部往后移动1,球最后的序列tree里保存的应该是这整个区间还有多扫个位置可以插入数据,那么线段树里从后往前扫描依次插入数据比如现在吧B插入到A位置,如果整个区间左侧还有>1; 6 7 if(x 2 #incl...
分类:
其他好文 时间:
2014-08-01 13:31:31
阅读次数:
177
概念 一个mongod服务可以有建立多个数据库,每个数据库可以有多张表,这里的表名叫collection,每个collection可以存放多个文档(document),每个文档都以BSON(binary json)的形式存放于硬盘中,因此可以存储比较复杂的数据类型。它是以单文档为单位存储的,你可以任...
分类:
数据库 时间:
2014-08-01 13:09:31
阅读次数:
561
Mobile phoneshttp://poj.org/problem?id=1195 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 const int M=1030; 5 class Two_Tree_Array {...
分类:
其他好文 时间:
2014-08-01 13:03:01
阅读次数:
168
//文件或目录转换成 TreeViewprocedure DirToTreeView(Tree: TTreeView; Directory: string; Root: TTreeNode; IncludeFiles:Boolean);varSearchRec: TSearchRec;ItemTem...
分类:
其他好文 时间:
2014-08-01 12:52:21
阅读次数:
267