自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(53)
  • 收藏
  • 关注

原创 数据结构课程设计-学生信息管理

#include#include#include#include#define LEN sizeof(struct Student)struct Student //学生信息的结构体声明{ unsigned int num; //记录学号 char grade[10]; //记录年级 char name[20]; //记

2015-12-24 10:51:06 871

原创 总结

通过这个学期的学习,翻转课堂给了我自主学习的机会并且开始养成习惯,并且通过写博文学到了知识,博文很有趣,可以在写东西中学到东西,很有成就感,同时,经过这学期,我还认识到学习应该有更多的主动性,要在学习中寻找乐趣,要在以后的学习中更加主动,并且,学的知识要及时巩固,不能一起累积到一块再复习,时间长了就快忘干净了,不利于牢固知识,还有就是看翻转课堂的时候应该边看书边看视频 ,有助于理解内容。感觉这学期

2015-12-18 19:42:50 631 1

原创 第十五周项目2 用哈希法组织关键字

#include #include #define N 15#define M 26int H(char *s){ return ((*s-'a'+1)%M);}int main(){ char *s[N]= {"if", "while", "for", "case", "do", "break", "else", "struct", "union", "int"

2015-12-18 09:12:48 438

原创 第十五周项目1 验证算法

#include #define MaxSize 100 #define NULLKEY -1 #define DELKEY -2 typedef int KeyType; typedef char * InfoType; typedef struct{ KeyType key;

2015-12-18 08:39:57 483

原创 第十二周项目4 二叉树排序树中的查找路径

#include #include #define MaxSize 100typedef int KeyType; typedef char InfoType;typedef struct node { KeyType key; InfoType

2015-12-18 08:36:48 422

原创 第十四周项目3 二叉树排序

#include #include typedef int KeyType;typedef char InfoType[10];typedef struct node { KeyType key; InfoType data; struct node *lch

2015-12-18 08:21:47 363

原创 十四周项目2 二叉树排序树中的查找路径

#include #include #define MaxSize 100typedef int KeyType; //定义关键字类型typedef char InfoType;typedef struct node //记录类型{ KeyType key;

2015-12-15 22:30:57 347

原创 第十四周项目1验证折半查找

非递归式:#includeusing namespace std;int main(){ int low=0,high,n; int a[100]; int i=0,f; cout<<"Please input the number of data and what data do you want to find"<<endl; while(cin>>n) { cin

2015-12-15 20:58:03 359

原创 第十周项目3 利用二叉树遍历思想解决问题

点击打开链接1点击打开链接21:int Nodes(BTNode *b){ if(b==NULL) { return 0; } else { return Nodes(b->lchild)+Nodes(b->rchild)+1; }}int main(){ BTNode *b; CreateBTNode(b,"A(B(D,E(H(J,

2015-12-15 19:58:50 465

原创 第九周项目4 广义表的算法库及应用

typedef char ElemType;typedef struct lnode{ int tag; //节点类型标识 union { ElemType data; //原子值 struct lnode *sublist; //指向子表的指针 } val; st

2015-12-15 19:44:03 307

原创 第九周项目3 稀疏矩阵的三元组表示的应用2

main函数:#include"tup.h"int main(){ TSMatrix ta,tb,tc; int A[M][N]= { {0,0,1,0,0,0,0}, {0,2,0,0,0,0,0}, {3,0,0,0,0,0,0}, {0,0,0,5,0,0,0}, {0,0,0,0

2015-12-15 19:39:48 415

原创 第九周项目3 稀疏矩阵的三元组表示的实现1

头文件tup,h#include "stdio.h"#define M 6#define N 7#define MaxSize 100 typedef int ElemType;typedef struct{ int r; int c; ElemType d;

2015-12-15 19:34:06 427

原创 第九周项目2 对称矩阵压缩存储的实现与应用2

#include #define N 4#define M 10int value(int a[],int i,int j);void madd(int a[],int b[],int c[][N]);void mult(int a[],int b[],int c[][N]);void disp1(int a[]);void disp2(int c[][N]);int main()

2015-12-15 19:30:18 487

原创 第九周项目2 对称矩阵压缩存储的实现与应用1

#include #include #define N 4void Init(int *&b);void Assign(int b[], int e, int i, int j);void Disp(int b[]);void Destroy(int b[]);int main(){ int *b1; int i, j; int v;

2015-12-15 19:27:45 421

原创 第九周 项目1 猴子选大王 (数组)

#include #define MaxSize 8void king(int m,int n)//m猴子的数量,n是出列的数。{ int mon[MaxSize]; int i=0,j=0,t=-1; while(i<m) { mon[i]=1; i++; } i=0; while(i<m)

2015-12-15 19:24:37 408

原创 第八周项目5 计数的模式匹配

点击打开链接实现函数:int str_count(SqString s,SqString t){ int i=0,j=0,count=0; while (i<s.length && j<t.length) { if (s.data[i]==t.data[j]) { i++;

2015-12-15 19:21:03 366

原创 第八周项目4 字符串加密

点击打开链接SqString EnCrypt(SqString p){ int i=0,j; SqString q; while (i<p.length) { for (j=0; p.data[i]!=A.data[j]; j++); if (j>=p.length) //在A串中未找到p.data[i]字

2015-12-15 19:17:01 344

原创 第八周项目3 顺序串算法库

点击打开链接1的实现函数:void Trans(SqString &s, char c1, char c2){ int i; for (i=0; i<s.length; i++) if (s.data[i]==c1) s.data[i]=c2;}1的main函数:#include #include "sqString.h"

2015-12-15 19:06:41 414

原创 第八周项目2 建立链串的算法库

头文件:typedef struct snode{ char data; struct snode *next;} LiString;void StrAssign(LiString *&s,char cstr[]); //字符串常量cstr赋给串svoid StrCopy(LiString *&s,LiString *t); //串t复制给串sbool StrE

2015-12-14 19:17:51 375

原创 第八周项目1 建立顺序串的算法库

头文件:#define MaxSize 100 //最多的字符个数typedef struct{ char data[MaxSize]; //定义可容纳MaxSize个字符的空间 int length; //标记当前实际串长} SqString;void StrAssign(SqString &s,c

2015-12-14 19:03:59 329

原创 停车场模拟

#include #include #define N 3 #define M 4 #define Price 2 typedef struct{ int CarNo[N]; int CarTime[N]; int top;

2015-12-14 18:53:16 706

原创 第七周项目5 排队看病模拟

#include #include typedef struct qnode{ int data; struct qnode *next;} QNode; typedef struct{ QNode *front,*rear;} QuType; void SeeDoctor(){ int sel,flag=1,

2015-12-14 18:48:49 578

原创 第七周 项目4 队列数组

点击打开链接#include #include #include "liquene.h"#define N 10int main(){ int i, a; LiQueue *qu[N]; for (i=0; i<N; i++) InitQueue(qu[i]); printf("输入若干正整数,以0结束: ")

2015-12-14 18:20:23 360

原创 第七周项目3 负数把正数赶出队列

点击打开链接main函数:#include #include "sqqueue.h" int main() { ElemType e; SqQueue *q; printf("(1)初始化队列q\n"); InitQueue(q); printf("(2)依次进队列元素a,b,c\n"); if (

2015-12-14 17:26:14 309

原创 第六周项目4 数制转换

点击打开链接进制变换实现函数void MultiBaseOutput (int number,int base) { int i; LiStack *S; InitStack(S); while(number) { Push(S,number%base); number/

2015-12-14 17:21:32 343

原创 第六周项目5 后缀表达式

点击打开链接#include #include #include "sqstack.h" #define MaxOp 7 struct { char ch; int pri; } lpri[]= {{'=',0},{'(',1},{'*',5},{'/',5},{'+',3},{'-',3},{')',6}}, r

2015-12-14 17:05:07 273

原创 第四周项目3 单链表应用3

点击打开链接int main() { LinkList *A, *B; int i; ElemType a[]= {1, 3, 2, 9}; ElemType b[]= {0, 4, 5 ,6, 7, 8}; InitList(A); for(i=3; i>=0; i--) ListInsert(A

2015-12-14 17:03:07 331

原创 第四周项目3 单链表应用2

点击打开链接int main() { LinkList *A, *B; int i; ElemType a[]= {1,3,2,9}; ElemType b[]= {0,4,7,6,5,8}; InitList(A); for(i=3; i>=0; i--) ListInsert(A, 1, a[i

2015-12-14 16:49:19 362

原创 第四周项目6 多项式求和

#include #include #define MAX 20 typedef struct { double coef; int exp; } PolyArray; typedef struct pnode { double coef;

2015-12-14 16:42:14 281

原创 第四周项目3 单链表应用1

点击打开链接#include"linklist.h" int main() { linklist *L; ElemType a[]= {1,3,5,7, 2,4,8,10}; CreateListR(L,a,8); printf("L:"); DispList(L); Reverse(L); print

2015-12-14 16:38:45 347

原创 第三周项目2 建设“顺序表”算法库

头文件LinkList.h#include #include typedef int ElemType; typedef struct node { int data; node *next; }linklist; void InitList( linklist *& ); void ListInsert(linklist *,int ,int )

2015-12-14 16:22:07 248

原创 第十二周项目三 图遍历算法实现

深度:源文件:#include"head.h"extern visited[MAXV];void DFS(ALGraph *G, int v){ ArcNode *p; int w; visited[v]=1; printf("%d ", v); p=G->adjlist[v].firstarc; while (p!=NULL) {

2015-12-11 08:42:00 380

原创 第十二周项目2操作用邻接表存储的图

int OutDegree(ALGraph *G,int v){ ArcNode *p; int n=0; p=G->adjlist[v].firstarc; while (p!=NULL) { n++; p=p->nextarc; } return n;}//输出图G中每个顶点的出度void Out

2015-12-07 17:08:53 266

原创 第十二周项目1 图基本算法库

头文件:#define MAXV 100 #define INF 32767 typedef int InfoType;//以下定义邻接矩阵类型typedef struct{ int no; InfoType info; } VertexType;

2015-12-07 16:18:04 276

原创 第十一周项目2 用二叉树求解代数表达式

#include #include #include#include #define MaxSize 100typedef char ElemType;typedef struct node{ ElemType data; struct node *lchild; struct node *rchild;

2015-12-04 08:52:25 336

原创 第十一周项目1 算法验证4 哈夫曼树

#include #include #define N 50 #define M 2*N-1 //哈夫曼树的节点结构类型typedef struct{ char data; double weight; int parent; int lchild; int rchild; } HT

2015-11-30 17:18:27 442

原创 第十一周项目1 算法验证3中序线索化二叉树的算法验证

#include #include #define MaxSize 100typedef char ElemType;typedef struct node{ ElemType data; int ltag,rtag; struct node *lchild; struct node *rchild;} TBTNode;void Cre

2015-11-30 17:16:18 399

原创 第十一周项目1 验证算法2二叉树构造算法的验证

#include "btree.h"BTNode *CreateBT1(char *pre,char *in,int n){ BTNode *s; char *p; int k; if (n<=0) return NULL; s=(BTNode *)malloc(sizeof(BTNode)); s->data=*pre;

2015-11-30 16:48:48 547

原创 第十一周项目1 验证算法1层次算法遍历的验证

main.cpp:#include "btree.h"void LevelOrder(BTNode *b){    BTNode *p;    BTNode *qu[MaxSize];       int front,rear;     front=rear=-1;         rear++;    qu[rear]=b;         while (front!=re

2015-11-30 16:25:27 369

原创 第十周项目2 二叉树遍历的递归运算

#include #include "btree.h"void PreOrder(BTNode *b) { if (b!=NULL) { printf("%c ",b->data); PreOrder(b->lchild); PreOrder(b->rchild); }}void In

2015-11-23 16:45:44 481

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除