码迷,mamicode.com
首页 >  
搜索关键字:struct sk_buff    ( 19001个结果
算法与数据结构--图的实现、基本操作及应用
#include #include #include using namespace std; #define INFINITY DBL_MAX //无穷大 #define MAX_VERTEX_NUM 20 //最大顶点个数 enum GraphKind //图的类型 { DG,DN,UDG,UDN//有向图、有向网、无向图、无向网 }; //弧结构 typedef struct...
分类:其他好文   时间:2014-06-07 01:52:18    阅读次数:214
[数据结构] 二叉树的建立及其基本操作
如图: 代码:   #include #include #include #include using namespace std; char ch; typedef struct BinNode { char data; struct BinNode *lchild,*rchild; }BinNode,*BinTree; //二叉树链式...
分类:其他好文   时间:2014-06-05 09:15:24    阅读次数:203
二叉树的链表实现
直接上代码: /* 二叉树的链表实现: 以及三种遍历方式: author:天下无双 Date:2014-5-28 Version:2.0 */ #include #include typedef int T;//树内节点的数据类型 using namespace std; class BiTree { private: struct BiNode{ T data; BiN...
分类:其他好文   时间:2014-06-05 06:30:49    阅读次数:273
POJ - 1111 Image Perimeters
题意:求'X'围成的周长 思路:按理说每增加一个就是周长加4,但是要减去重复的地方,这里我是用BFS做的,如果是BFS的模板思路的话是不行的,应该要先取出再标记 #include #include #include #include #include using namespace std; const int MAXN = 30; struct node { int x,y; ...
分类:其他好文   时间:2014-06-05 06:23:39    阅读次数:221
自然对齐:sizeof struct, union
自然对齐: 1.一个基本类型实例的大小要能整除其地址值。 2.数组有着和数组里类型本身相同的对齐要求。 3.一个聚集类型的实例,其对齐要求最严格的子类型的排列要能整除聚集的地址 在32位机器上, char的大小为1(以字节计),所以它可以被存储在内存的任意地址处 short的大小为2,所以它只能存储在“偶数”地址处 integer和指针的大小为4(32位机上一个字为4个字节),所以它们只能存储在一个字界中 double的大小为8,所以它只能存储在两个字界中...
分类:其他好文   时间:2014-06-05 03:52:15    阅读次数:200
hdu 1863 畅通工程
题目:         链接:点击打开链接 题意:         中文题 算法: 思路:         赤裸裸的最小生成树。。 代码: #include #include using namespace std; struct node{ int u,v,w; } e[110]; int p[110]; int n,m,sum,ans; int cmp(node...
分类:其他好文   时间:2014-06-05 03:50:23    阅读次数:232
POJ 2241 The Tower of Babylon
DP求解。对Blocks的先按照X降级,再按照Y降级排序,可以转化为最长公共子序列问题,即求子序列权值之和最大。 #include #include #include using namespace std; #define MAX_SIZE 300 struct Block{ int x; int y; int height; }; int nums...
分类:其他好文   时间:2014-06-03 04:39:44    阅读次数:223
二叉树的存储与遍历
typedef char status; typedef char Telemtype; #define NULL 0 #define OK 1 typedef struct bitnode{ Telemtype data; struct bitnode *lchild,*rchild; }bitnode,*bitree; Creatbitree(bitree &t) { //先序创建二叉...
分类:其他好文   时间:2014-06-03 00:47:39    阅读次数:195
struct对齐详解
更加形象介绍了struct的size计算...
分类:其他好文   时间:2014-06-03 00:41:32    阅读次数:308
【算法与数据结构】哈希表-链地址法
哈希表的链地址法来解决冲突问题将所有关键字为同义词的记录存储在同一个线性链表中,假设某哈希函数产生的哈希地址在区间[0, m - 1]上,则设立一个至振兴向量Chain ChainHash[m];数据结构//链表结点typedef struct _tagNode{ int data; ...
分类:其他好文   时间:2014-05-31 19:23:52    阅读次数:436
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!