1 /* PRESET CODE BEGIN - NEVER TOUCH CODE BELOW */
2 3 #include 4 #include 5 6 typedef struct node 7 { int coef, exp; //coe...
分类:
其他好文 时间:
2014-05-01 20:33:27
阅读次数:
342
先用bfs预处理出层次图,然后在层次图上用dfs找增广路径,理论复杂度O(n*n*m)const
int INF=0xfffffff ;struct node{ int s,t,cap,nxt ;}e[200005] ;int
m,n,head[10005],level[10005],cnt ...
分类:
其他好文 时间:
2014-05-01 20:05:16
阅读次数:
379
>原文标题:Global Variables in Node.js
原文链接:[http://www.hacksparrow.com/global-variables-in-node-js.html](http://www.hacksparrow.com/global-variables-in-.....
分类:
Web程序 时间:
2014-05-01 19:46:09
阅读次数:
490
Ternary Search Tree C++实现...
分类:
编程语言 时间:
2014-05-01 17:51:59
阅读次数:
410
一、 序言
上一篇文章中,给出了 trie 树的一个实现。可以看到,trie 树有一个巨大的弊病,内存占用过大。
本文给出另一种数据结构来解决上述问题---- Ternary Search Tree (三叉树)
二、数据结构定义
Trie 树中每个节点包含了 26 个指针,但有很大一部分的指针是 NULL 指针,因此浪费了大量的资源。
一种改进措施就是,以一棵树来代替上述的指针数组。...
分类:
其他好文 时间:
2014-05-01 17:49:30
阅读次数:
326
题目:
Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height.
翻译:
给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。
思路:
要使二叉树的高度最小,则要尽量使其左右子树的节点数目相当,自然就考虑到将其构造成为二叉排序树,且将有序数组的中间大的数作为根节点,这样得到的二叉树的高度便是最小的。...
分类:
其他好文 时间:
2014-05-01 17:48:45
阅读次数:
321
题意:多维的曼哈顿最远距离
思路:做了1,2,3维的,其实就是枚举所有绝对值的可能的表达式
#include
#include
#include
#include
using namespace std;
const int MAXN = 100005;
const int M = 5;
const double inf = 1e200;
struct node{
double x...
分类:
其他好文 时间:
2014-05-01 17:31:01
阅读次数:
283
题目:寻找最长上升自序列。
代码:
#include
#include
#include
#include
using namespace std;
struct node
{
int w,s; //重量,速度
int num; //编号
int t; //用来记录当前编号...
分类:
其他好文 时间:
2014-05-01 17:17:32
阅读次数:
285
1.Scene Graph体系结构浅析
javafx以tree的形式组织nodes,每一个node就是一个control,即UI组件。
node分为leaf node与branch node, root node。
scene体系中最关键的类:
Scene:代表包含所有UI组件的顶级容器
Node:是一个抽象类,代表UI组件的基类
Parent:是一个抽象类,代表branch...
分类:
移动开发 时间:
2014-04-30 22:16:39
阅读次数:
463