typedef char status;typedef char Telemtype;#define
NULL 0#define OK 1typedef struct bitnode{ Telemtype data; struct bitnode
*lchild,*rchild;}bitnode.....
分类:
其他好文 时间:
2014-06-09 21:39:56
阅读次数:
209
#include using namespace std;struct Node{ Node
*next; int elem;};void creatList(Node* &head){ head = new Node; int elem;
cin>>elem; ...
分类:
其他好文 时间:
2014-06-09 16:07:55
阅读次数:
229
#include ssize_t recvfrom(int sockfd, void *buff,
size_t nbytes, int flags, struct sockaddr *from, socklen_t *addrlen);ssize_t
sendto(int sockfd, cons...
分类:
其他好文 时间:
2014-06-09 13:22:32
阅读次数:
319
//定义二维平面上的点struct Point{ int x; int y;
Point(int a=0, int b=0):x(a),y(b){}};bool operator==(const Point& left,
const Point& right){ return...
分类:
其他好文 时间:
2014-06-08 22:26:17
阅读次数:
357
写了个函数指针,这题目很水,但是佷烦。 1 #include 2 #include 3
#include 4 #include 5 using namespace std; 6 7 #define MAXN 305 8 9 typedef
struct {10 int id, g...
分类:
其他好文 时间:
2014-06-08 20:55:48
阅读次数:
202
数组必须开大点#include #include #include #include using
namespace std;struct node{ int x,ans;}q[1000005];int jx[]={-1,1};int n,k;int
map[1000005],v[100000...
分类:
其他好文 时间:
2014-06-08 20:48:03
阅读次数:
319
# include # include # include # include # include
//使用map解决一对一 的关系using namespace std;map mapdata;//数据存储typedef struct node{ long
num; char ch1[20]; c...
分类:
其他好文 时间:
2014-06-08 20:26:01
阅读次数:
235
题目链接题意: 给定一棵二叉树, 判断是否为平衡二叉树, 这里的平衡二叉树指的是:每个结点的左右子树的深度之差不超过1。附上代码:
1 /** 2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * ...
分类:
其他好文 时间:
2014-06-08 18:58:35
阅读次数:
194
被坑了3个小时,本来以为算法错了,谁知道,竟然是素数筛弄错了!!!#include #include
#include #include #include using namespace std;int a[10001];int v[10001];int
n,m;struct node{ int.....
分类:
其他好文 时间:
2014-06-08 18:56:44
阅读次数:
259
题目链接求二叉树最小深度,最小深度指的是:从根节点走到最近的叶子结点的最短长度附上代码: 1 /**
2 * Definition for binary tree 3 * struct TreeNode { 4 * int val; 5 * TreeNode
*left; 6...
分类:
其他好文 时间:
2014-06-08 18:43:48
阅读次数:
220