码迷,mamicode.com
首页 >  
搜索关键字:hdoj tree    ( 20544个结果
jQuery 动态加载树
本案例中用到了jquery的 tree插件,在本文的附件中可以下载jsp代码: "> jQuery Tree Refresh both Trees =-=====================java代码:本人用的是 servletpackage com;import...
分类:Web程序   时间:2014-05-26 19:11:15    阅读次数:367
【HDOJ】2546 饭卡
01背包,需要先对数据升序排序。这样保证优先购买最贵的东西,才满足背包条件。 1 #include 2 #include 3 #include 4 5 #define MAXNUM 1005 6 7 int prices[MAXNUM]; 8 int dp[MAXNUM]; 9 10 in...
分类:其他好文   时间:2014-05-26 04:41:18    阅读次数:164
笔试算法题(31):将有序数组转换成BST表示 & 线段树的应用
出题:要求将一个有序整数数组转换成最小深度的Binary Search Tree表示;分析:由于需要是最小深度,所以BST应保持平衡,左右节点数大致相当,并且BST中当前根节点大于所有其左子树中的元素,小于所有其右子树中的元素。对于排序数组而言,中间元素必然作为根节点,然后递归对由中间元素分割的左右...
分类:其他好文   时间:2014-05-26 03:49:39    阅读次数:369
56. 2种方法判断二叉树是不是平衡二叉树[is balanced tree]
is balanced tree
分类:其他好文   时间:2014-05-25 22:07:58    阅读次数:243
UVA Tree Summing
题目如下:  Tree Summing  Background LISP was one of the earliest high-level programming languages and, withFORTRAN, is one of the oldest languages currently being used. Lists,wh...
分类:其他好文   时间:2014-05-25 21:39:51    阅读次数:276
hdoj 4828 卡特兰数取模
Grids Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others) Total Submission(s): 93    Accepted Submission(s): 25 Problem Description   度度熊最近很喜欢玩游戏。这一天他在纸上画了...
分类:其他好文   时间:2014-05-25 16:52:16    阅读次数:251
Geeks : Kruskal’s Minimum Spanning Tree Algorithm 最小生成树
寻找图中最小连通的路径,图如下: 算法步骤: 1. Sort all the edges in non-decreasing order of their weight. 2. Pick the smallest edge. Check if it forms a cycle with the spanning tree formed so far. If cycle is n...
分类:其他好文   时间:2014-05-25 07:35:59    阅读次数:301
初涉Splay Tree
Splay Tree 支持的之中操作。 插入,删除,求前驱和后即,区间更新与查询。 先来一发Splay Tree最基础的操作——伸展。 #include #include #include #include #include #include #include #include #include #pragma comment(linker, "/STACK:102400...
分类:其他好文   时间:2014-05-25 04:27:37    阅读次数:291
字典树Trie
字典树Trie Trie,又称字典树,前缀树(prefix tree),是一种树形结构,用于保存大量的字符串。 它的优点是:利用字符串的公共前缀来节约存储空间。查找、插入复杂度为O(n),n为字符串长度。  它有3个基本性质: 1. 根节点不包含字符,除根节点外每一个节点都只包含一个字符。 2. 从根节点到某一节点,路径上经过的字符连接起来,为该节点对应的字符串。...
分类:其他好文   时间:2014-05-24 23:49:57    阅读次数:346
poj 2985 The k-th Largest Group 求第K大数 Treap, Binary Index Tree, Segment Tree
题目链接:点击打开链接 题意:有两种操作,合并集合,查询第K大集合的元素个数。(总操作次数为2*10^5) Treap模板(静态数组) #include #include #include #include #include const int maxNode = 500000 + 100; const int inf = 0x3f3f3f3f; struct Tr...
分类:其他好文   时间:2014-05-24 23:18:09    阅读次数:522
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!