链表中结点的分配和回收是由系统提供的标准函数malloc和free动态实现的,称之为动态链表。
如果程序支持指针,则可按照我们的一般形式实现链表, 需要时分配,不需要时回收即可.
动态链表的空间是可以动态扩展的。
typedef struct node{
EleType data;
struct node * pNext;
}Node;
有些高级语言中没有“指...
分类:
其他好文 时间:
2014-05-10 10:38:07
阅读次数:
297
题目来源:HDU 1542 Atlantis
题意:给你一些矩形(左下角和右上角)求面积
思路:参考here这个超赞的 一看就懂了
#include
#include
#include
#include
using namespace std;
const int maxn = 210;
struct node
{
double l, r, h;
int s, val;
nod...
分类:
其他好文 时间:
2014-05-07 08:59:09
阅读次数:
395
常见系统数据文件
下表列出了常见的系统数据文件及其查找函数。
以/etc/passwd文件为例,读取数据的程序框架如下:
void get_pw_entry()
{
struct passwd *ptr;
setpwent();
while ((ptr = getpwent()) != 0) {
……
}
endpwe...
分类:
其他好文 时间:
2014-05-07 08:46:54
阅读次数:
341
简单的说,i2c驱动也就三步吧,注册i2c设备,注册i2c设备驱动,创建sysfs文件供上层调用。
1. 注册i2c设备。
先定义一个i2c_board_info
static struct i2c_board_info __initdata xxxx_i2c_info[] = {
{
I2C_BOARD_INFO("XXX...
分类:
其他好文 时间:
2014-05-07 08:34:39
阅读次数:
333
题意:所有n个人围成一个圈,
#include
#include
struct Node
{
int data;
Node *next;
Node *prior;
};
Node* CreateList(Node* &head, int n);
Node* searchk(Node *ptr, Node* &head, int k);
Node* rsearchm(Node...
分类:
其他好文 时间:
2014-05-07 06:26:28
阅读次数:
327
关于结构体的一个问题:
看下面这个结构体的声明,把它记作A
struct node
{
int a;
float b;
struct node *next;
}s;
和如下的结构体声明,把它记作Bstruct node
{
int a;
float b;
struct node next;
}s;
他们的区别是啥?
今天学习《C和指针》第10...
分类:
编程语言 时间:
2014-05-07 03:19:10
阅读次数:
313
递归版
struct Edge
{
int from, to, cap, flow;
Edge(){}
Edge(int from, int to, int cap, int flow) : from(from), to(to), cap(cap), flow(flow){}
};
int n, m, s, t;
vector edges;
vector G[maxn];
bool v...
分类:
其他好文 时间:
2014-05-06 23:39:25
阅读次数:
351
n个数,只能用
F[i][j]=(F[i-1][j]+F[i-1][j-1])*j
F[i][j]代表i个数,有j个不同值的情况。比如A
大数模板
#include
#include
const int MAX =505;
struct BigNum
{
int num[MAX];
int len;
} a[51][51];
BigNum Add(...
分类:
其他好文 时间:
2014-05-06 23:06:51
阅读次数:
364
tm结构体的定义在time.h里面
struct tm {
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
};
/*...
分类:
系统相关 时间:
2014-05-06 22:26:46
阅读次数:
474
手动搭建struct2的时候,总是会碰到找不到Filter的问题,到底是怎么回事呢?
其实,关键就在于导入的五个jar包,我们最好是将它放在web-inf目录下,然后再组织导入,这样web.xml才能顺利找到。
至于struct.xml,目前放在src目录下就好。
自己的技术水平一向让自己无语,碰到这样个问题都得搞半天……...
分类:
其他好文 时间:
2014-05-06 15:31:26
阅读次数:
225