摘要:
1.*pa[]与(*pa)[]区别: *pa[3]: 运算符[]优先级高于*,所以*pa[3]表明pa是包含3个指针的数组; (*pa)[3]: pa是一个指针,它指向一个包含3个元素的数组。2.“const int *a” 与“int* const a”的区别: (1)const int ... 阅读全文
摘要:
1、排序的稳定性: 假设 Ki=Kj (1≤i≤n,1≤j≤n,i≠j),在排序前的序列中 i<j,如果排序后 i 仍然领先于 j ,则所用排序方法稳定;反之若可能使排序后序列 j 领先 i,则所用排序方法不稳 定。 2、内排序与外排序 内排序是在排序整个过程中,待排序的所有记录全部被放置在内存中; 阅读全文
摘要:
1 #include 2 using namespace std; 3 #define MAXSIZE 100 4 5 int Seq_Search(int *a, int n, int key) 6 { 7 int i; 8 for(i=0; ikey) 26 { 27 high--; 28 ... 阅读全文
摘要:
LinkQueue://链式队列#includeusing namespace std;typedef int elemType;struct QNode{ elemType data; QNode *next;};struct LinkQueue{ QNode *front; ... 阅读全文
摘要:
CycleStack//顺序循环队列#includeusing namespace std;typedef int elemType;const int MAXSIZE = 20;struct Queue{ elemType data[MAXSIZE]; int front;//头指针 ... 阅读全文
摘要:
LinkStack://链式栈#includeusing namespace std;typedef int elemType;typedef struct StackNode{ elemType data; StackNode *next;}*LinkList;struct LinkS... 阅读全文
摘要:
SeqStack: 阅读全文
摘要:
DuLink:#includeusing namespace std;typedef int elemType;typedef struct DulNode{ elemType data; DulNode *prior; DulNode *next;}*DuList;void In... 阅读全文
摘要:
LinkList:#includeusing namespace std;typedef int elemType;typedef struct Node{ elemType data; Node *next;}*LinkList;bool InitList(LinkList *L)//... 阅读全文
摘要:
Slist:#ifndef SLIST_H_#define SLIST_H_#include templatestruct Slist_node{ T element; Slist_node * next; Slist_node():element(),next(0){} e... 阅读全文