#define stack_init_size 100
#define stackincrement 10
typedef int ElemType;
typedef int status;
const status error=0;
const status ok=1;
const status overflow=-2;
const int MAXSIZE = 100;
typedef st...
分类:
其他好文 时间:
2014-05-26 06:17:29
阅读次数:
243
官网的驱动需要多个文件,为了提取ENC28J60驱动,改写如下:
原数据类型定义:
typedef unsigned char BYTE; /* 8-bit unsigned */
typedef unsigned short int WORD;...
分类:
其他好文 时间:
2014-05-26 05:02:58
阅读次数:
488
按先序序列输入字符序列(其中逗号表示空节点),输出该二叉树的层次遍历序列。
#include
#define END ','//表示空节点
using namespace std;
typedef char Elem_Type;
typedef struct BiTree
{
Elem_Type data;
struct BiTree *Lchild;
stru...
分类:
其他好文 时间:
2014-05-26 04:53:07
阅读次数:
261
题目链接:uva 1350 - Pinary
题目大意:给出n,输出第n给Pinary Number,Pinary Number为二进制数,并且没有连续两个1相连。
解题思路:dp[i]表示到第i位有dp[i]种,于是给定n,一层循环判断dp[i]≤n的话,就输出1,并且n减掉dp[i],注意输出0的时候,不能输出前导0.
#include
#include
typedef l...
分类:
其他好文 时间:
2014-05-26 04:38:12
阅读次数:
212
说明:
******不同的编译器和处理器,其结构体内部的成员有不同的对齐方式。
******使用sizeof()运算符计算结构体的长度。
###结构体中每个成员相对于结构首地址的偏移量都是成员大小的整数倍,如果有需要编译器会在成员之间加上填充字。
###结构体的总大小是结构体最宽基本类型成员大小的整数倍。如果需要编译器会在最后一个成员之后加上填充字。
struct A
{ unsigne...
分类:
编程语言 时间:
2014-05-25 00:40:40
阅读次数:
314
#include
#define maxn 1000;
//队列ADT---数组实现
struct queueRecord;
typedef struct queueRecord *Queue;
typedef int elementType;
int isEmpty(Queue Q);
int isFull(Queue Q);
Queue creatQueue(int maxn);
voi...
分类:
其他好文 时间:
2014-05-24 23:22:16
阅读次数:
368
题目链接:点击打开链接
题意:有两种操作,合并集合,查询第K大集合的元素个数。(总操作次数为2*10^5)
Treap模板(静态数组)
#include
#include
#include
#include
#include
const int maxNode = 500000 + 100;
const int inf = 0x3f3f3f3f;
struct Tr...
分类:
其他好文 时间:
2014-05-24 23:18:09
阅读次数:
522
只是实现了链表ADT的部分功能。
/*---编写打印出一个单链表的所有元素的程序---*/
#include
#include
struct Node{
int val;
struct Node *next;
};
Node *findEnd(Node *list){
while(list->next) list = list->next;
return list;
}
v...
分类:
其他好文 时间:
2014-05-24 22:30:37
阅读次数:
232
#include
#include
#include //system(); 这个指令需要用到此头文件
#include //toupper要用到
#include //在内存管理时用到的头文件
void main()
{
int i;
struct ListEntry{
int number; //数据域
struct ListEntry *next; //指向 下...
分类:
其他好文 时间:
2014-05-24 18:15:27
阅读次数:
258
/*---给你一个链表L和另一个链表P,它们包含以升序排列的整数。操作PrintLots(L,P)
将打印L中那些由P所指定位置上的元素。---*/
#include
#include
struct Node{
int val;
struct Node *next;
};
Node *findEnd(Node *list){
while(list->next) list = l...
分类:
其他好文 时间:
2014-05-24 14:27:42
阅读次数:
224