1 //数组实现 栈 2 #include 3 using namespace std; 4 5 struct Sqstack{ 6 int data[100]; 7 int * base; 8 int * top; 9 int len ; //当前已经用的长...
分类:
其他好文 时间:
2014-09-01 22:40:33
阅读次数:
233
#include #include #include #include #include #define N 200002using namespace std;struct node{ int l,r; int lz;} q[4*N];struct Line{ int x,y;}...
分类:
其他好文 时间:
2014-09-01 22:35:33
阅读次数:
229
实现一个基本的链表,包括在链表后添加数据节点和输出链表i所有数据的功能 1 #include 2 #include 3 4 typedef struct node 5 { 6 int data; 7 struct node *link; 8 }NODE; 9 10 //定义头指针1...
分类:
编程语言 时间:
2014-09-01 22:33:13
阅读次数:
319
位图文件由三部分组成:文件头 + 位图信息 + 位图像素数据 位图文件头。位图文件头主要用于识别位图文件。以下是位图文件头结构的定义: typedef struct tagBITMAPFILEHEADER { // bmfh
WORD bfType;
...
分类:
其他好文 时间:
2014-09-01 21:16:53
阅读次数:
187
题目来源:HDU 3726 Graph and Queries
题意:见白书
思路:刚学treap 参考白皮书
#include
#include
#include
using namespace std;
struct Node
{
Node *ch[2];
int r;
int v;
int s;
Node(int v): v(v) {
ch[0] = ch[1] ...
分类:
其他好文 时间:
2014-09-01 21:12:23
阅读次数:
234
(注:最左边是文件头的偏移量。) IMAGE_DOS_HEADER STRUCT { +0h WORD e_magic // Magic DOS signature MZ(4Dh 5Ah) DOS可执行文件标记 +2h WORD e_cblp // Bytes on la...
分类:
其他好文 时间:
2014-09-01 20:58:23
阅读次数:
603
经典题目,代码如下: 1 #include 2 #include 3 using namespace std; 4 struct ListNode { 5 int m_iData; 6 ListNode* m_pNext; 7 }; 8 ListNode* Reverse(Lis...
分类:
其他好文 时间:
2014-09-01 19:10:03
阅读次数:
257
并查集 +kruskal#include"stdio.h"#include"string.h"#include"stdlib.h"int n,m;struct A{ int a,b; int len; int flag;}eage[15555];int set[1011];struct B{ int...
分类:
其他好文 时间:
2014-09-01 15:29:03
阅读次数:
214
套接字地址结构: 每个协议簇都定义了它自己的套接字地址结构。 这些结构的名字都已 sockaddr_ 开头, 并对应每个协议簇的唯一后缀结束。IPv4套接字地址结构: 1 struct in_addr { 2 in_addr_t s_addr; // 32-...
分类:
其他好文 时间:
2014-09-01 13:51:43
阅读次数:
233
一、二叉树 1、定义 二叉树是一棵树,其中每个节点都不能多于2个儿子。 2、实现 typedef struct TreeNode *PtrToNode;typedef PtrToNode Tree;typedef char ElementType;struct TreeNode{ ElementTy...
分类:
其他好文 时间:
2014-09-01 13:49:03
阅读次数:
157