这两天学习了网络流,下面是ISAP算法模板:
const int inf = 0x3fffffff;
template
struct Isap
{
int top;
int d[N], pre[N], cur[N], gap[N];
struct Vertex{
int head;
} V[N];
struct Edge{...
分类:
其他好文 时间:
2014-05-26 04:10:16
阅读次数:
252
1 #include 2 using namespace std; 3 template 4
class Queue 5 { 6 private: 7 struct node 8 { 9 T data;10 node * next;11 ...
分类:
其他好文 时间:
2014-05-26 02:19:36
阅读次数:
213
http://acm.hdu.edu.cn/showproblem.php?pid=1086跨立实验算法#include#include#include#includeusing
namespace std;struct Point{ double x,y;} ;struct Line{ ...
分类:
其他好文 时间:
2014-05-26 02:10:52
阅读次数:
224
??
// //广度优先遍历二叉树
// //从一个顶点开始,识别所有可到达顶点
// //的方法叫作广(宽)度优先搜索,这种
// //搜索可使用队列来实现
typedef struct binarytree
{
EleType data;
struct binarytree *LeftChild;
struct binarytree *RightChild...
分类:
其他好文 时间:
2014-05-25 18:25:35
阅读次数:
316
1.链队列结构
typedef struct QNode /* 结点结构 */
{
QElemType data;
struct QNode *next;
}QNode,*QueuePtr;
typedef struct /* 队列的链表结构 */
{
QueuePtr front,rear; /* 队头、队尾指针 */
}LinkQueue;...
分类:
编程语言 时间:
2014-05-25 10:25:15
阅读次数:
325
哈希表简单实现,练个手
#include "stdafx.h"
#include
using namespace std;
#define HASHSIZE 12
typedef struct HashTable
{
int *elem;
int count;
}HashTable;
int m = 0;
void Print(HashTable* ...
分类:
其他好文 时间:
2014-05-25 07:02:06
阅读次数:
169
很少用bfs进行最短路搜索,实际BFS有时候挺方便得,省去了建图以及复杂度也降低了O(N*M);UVA 11624 写的比较挫#include #include
#include #include using namespace std;struct node{ int ft; int ...
分类:
其他好文 时间:
2014-05-25 03:23:54
阅读次数:
210
说明:
******不同的编译器和处理器,其结构体内部的成员有不同的对齐方式。
******使用sizeof()运算符计算结构体的长度。
###结构体中每个成员相对于结构首地址的偏移量都是成员大小的整数倍,如果有需要编译器会在成员之间加上填充字。
###结构体的总大小是结构体最宽基本类型成员大小的整数倍。如果需要编译器会在最后一个成员之后加上填充字。
struct A
{ unsigne...
分类:
编程语言 时间:
2014-05-25 00:40:40
阅读次数:
314
#include
#define maxn 1000;
//队列ADT---数组实现
struct queueRecord;
typedef struct queueRecord *Queue;
typedef int elementType;
int isEmpty(Queue Q);
int isFull(Queue Q);
Queue creatQueue(int maxn);
voi...
分类:
其他好文 时间:
2014-05-24 23:22:16
阅读次数:
368
尽量以const, enum,inline 替换 #define --》 宁可以编译器替换预处理器...
分类:
编程语言 时间:
2014-05-24 18:29:52
阅读次数:
321