博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年11月22日

摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 typedef int DataType; 4 5 typedef struct BiThrNode{ 6 DataType data; 7 struct BiThrNode *lchild; 8 struct BiThrNode *rchild; 9 unsigned ltag;10 unsigned rtag;11 }BiThrNode,*BiThrTree;12 13 BiThrTree pre;14 15 void InThreading... 阅读全文

posted @ 2012-11-22 10:48 皇星客栈--Linux 阅读(241) 评论(0) 推荐(0) 编辑

摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<iostream> 4 #define MAXVALUE 100 //定义最大权值 5 #define MAXLEAF 50 //定义哈夫曼树中叶子节点个数 6 #define MAXNODE MAXLEAF*2-1 7 8 typedef struct{ 9 int weight;10 int parent;11 int lchild;12 int rchild;13 ... 阅读全文

posted @ 2012-11-22 10:47 皇星客栈--Linux 阅读(195) 评论(0) 推荐(0) 编辑

摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<iostream> 4 #define MAXVALUE 100 //定义最大权值 5 #define MAXLEAF 50 //定义哈夫曼树中叶子节点个数 6 #define MAXNODE MAXLEAF*2-1 7 #define MAXBIT 100 //定义哈夫曼编码的最大长度 8 9 typedef struct{10 int weight;11 ... 阅读全文

posted @ 2012-11-22 10:47 皇星客栈--Linux 阅读(222) 评论(0) 推荐(0) 编辑

摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define MAXNODE 100 4 typedef int status; 5 #define MAX 100 6 7 typedef struct Bitree 8 { 9 struct Bitree *lchild;10 struct Bitree *rchild;11 char data;12 }BiTree ,*BiTnode;13 14 BiTree *Create( )//建立二叉树15 {16 int i,j;17 BiTr... 阅读全文

posted @ 2012-11-22 10:46 皇星客栈--Linux 阅读(169) 评论(0) 推荐(0) 编辑

2012年11月8日

摘要: 在unix系统调用中,标准输入描述字用stdin,标准输出用stdout,标准出错用stderr表示,但在一些调用函数,引用了STDIN_FILENO表示标准输入才,同样,标准出入用STDOUT_FILENO,标准出错用STDERR_FILENO.他们的区别:stdin等是FILE *类型,属于标准I/O,在<stdio.h>。STDIN_FILENO等是文件描述符,是非负整数,一般定义为0, 1, 2,属于没有buffer的I/O,直接调用系统调用,在<unistd.h>。 下面一个例子是对STDOUT_FIFENO 和STDIN_FILENO的应用:#include 阅读全文

posted @ 2012-11-08 15:09 皇星客栈--Linux 阅读(320) 评论(0) 推荐(0) 编辑

2012年10月27日

摘要: 一)m_hWnd①m_hWnd这个成员变量,最早是定义在类CWnd中,而且是类CWnd的第一个数据成员,先看一下MSDN的解析:ThehandleoftheWindowswindowattachedtothisCWnd.Them_hWnddatamemberisapublicvariableoftypeHWND.由此可知,它是窗口类的一个句柄,凡是从CWnd派生的类都有这个句柄,凡是以CWnd派生的类定义的对象内部也都有这个句柄,它是类或者对象标识自己的句柄。凡是窗口都有一个句柄用来标识自己,在CWnd类中将这个句柄作为一个成员变量直接封装了,所以CWnd类的成员函数都没有句柄这个参数了,比如 阅读全文

posted @ 2012-10-27 19:21 皇星客栈--Linux 阅读(1389) 评论(0) 推荐(0) 编辑

2012年10月20日

摘要: View Code 1 //----------------------图的广度优先搜索----------------------- 2 #include<stdio.h> 3 #include<stdlib.h> 4 5 #define MAXQUEUE 10 //队列的最大容量 6 7 8 struct node //图顶点结构声明 9 { 10 int vertex; //顶... 阅读全文

posted @ 2012-10-20 10:41 皇星客栈--Linux 阅读(177) 评论(0) 推荐(0) 编辑

2012年10月19日

摘要: 这个写法我认为精简View Code 1 #include<stdio.h> 2 #include<malloc.h> 3 #include<stdlib.h> 4 5 typedef struct node 6 { 7 int vertex; 8 struct node *nextnode; 9 }*graph,Linknode;10 11 struct node head[9];12 int visited[9];13 14 void creategraph( int *node,int num )15 {16 graph newnode;17 grap 阅读全文

posted @ 2012-10-19 17:30 皇星客栈--Linux 阅读(188) 评论(0) 推荐(0) 编辑

2012年10月15日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1496View Code 1 #include<stdio.h> 2 #include<memory.h> 3 4 int pin[101]; 5 int hash[2000001]; 6 7 int main( ) 8 { 9 int a;10 int b;11 int c;12 int d;13 int i;14 int j;15 int sum;16 for( i=1; i<101; i++ )17 pin[i] = ... 阅读全文

posted @ 2012-10-15 15:07 皇星客栈--Linux 阅读(235) 评论(0) 推荐(0) 编辑

2012年10月14日

摘要: (HDOJ-1425 sort )http://acm.hdu.edu.cn/showproblem.php?pid=1425题目特点:数据量大数据在一定范围View Code 1 #include<cstring> 2 #include<cstdio> 3 //using namespace std; 4 #define num 1000001 5 int Hash[num]; 6 7 int main( ) 8 { 9 int n;10 int m;11 int mid = 500000;12 int max = -mid;13 int min ... 阅读全文

posted @ 2012-10-14 20:23 皇星客栈--Linux 阅读(176) 评论(0) 推荐(0) 编辑