- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 循环队列的实现
#include #include #define MAXQSIZE 20 typedef struct{ int *base; // 初始化的动态分配存储空间 int front; int rear; }sqQueue; //创建 int InitQueue(sqQueue *q) { q->base = (int*)malloc(MAXQSIZE*sizeof(int))
2017-03-30 15:53:16
179
转载 链式栈的实现
#include #include typedef struct LNode { int val; struct LNode *next; }node; typedef struct Stack { node *top; int size; }stack; stack *create()
2017-03-30 11:25:52
151
原创 单链表操作
#include #include typedef struct Node{ int data; struct Node* pNext; }NODE; //创建 NODE* CreateLinkList(void) { int value,num; int i; NODE* pHead = (NODE*)malloc(sizeof(NODE)); if(pHead == NUL
2017-03-29 21:29:29
137
原创 顺序栈的操作
#include #include #define STACK_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 10 //存储空间分配增量 typedef struct{ int *base; int *top; int stacksize; }SqStack; //初始化栈 int InitStack(SqStack *s)
2017-03-29 21:25:51
183
原创 链表简单操作
#include #include #define Length 5 typedef struct LinkList{ int data; struct LinkList* pNext; }LinkList; LinkList* CreateLinkList(void) { int i; LinkList* pHead = (LinkList*)malloc(sizeof(Link
2017-03-25 20:38:39
133
原创 C++基础整理
一、友元 a.友元函数:允许外面的类或函数去访问类的私有变量和保护变量 b.友元类 class A { … public: friend class B; … }; 类B的所有成员函数都是类A的友元函数,能存取类A的私有成员和保护成员 友元类的注意: 1)友元关系不能被继承 2)友元关系是单向的,不具有交换性。若类B是类A的友元,类A不一定是类B的友元,要看在类中是否有相
2016-10-18 21:58:51
313
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人