體會是指將學習的東西運用到實踐中去,通過實踐反思學習內(nèi)容并記錄下來的文字,近似于經(jīng)驗總結(jié)。好的心得體會對于我們的幫助很大,所以我們要好好寫一篇心得體會下面小編給大家?guī)黻P于學習心得體會范文,希望會對大家的工作與學習有所幫助。
數(shù)據(jù)結(jié)構(gòu)課程設計心得體會800字篇一
課程設計報告
學 號 姓 名 班 級 指導教師
xxx xxx xxx xxx 安徽工業(yè)大學計算機學院
2014年6月
利用棧實現(xiàn)迷宮問題的求解
一、問題描述
以一個m*n的長方陣表示迷宮,0和1分別表示迷宮中的通路和墻壁。設計一個程序,對任意設定的迷宮,求出一條從入口到出口的通路,或得出米有通路的結(jié)論。
二、設計思路
(1)以二維數(shù)組maze[m][n]表示迷宮,數(shù)組中元素值為0表示通路,1表示障礙。
(2)其中迷宮的入口位置和出口位置默認于maze數(shù)組的起始元素位置和最后個元素位置。
(3)以鏈表作存儲結(jié)構(gòu)的棧類型,實現(xiàn)求解迷宮的非遞歸程序。
三、數(shù)據(jù)結(jié)構(gòu)定義 typedef struct{
int x; int y; }item; typedef struct{ int x,y,d; }datatype; typedef struct{ datatype data[1000]; int top; }seqstack,*pseqstack;
typedef struct{ datatype data[1000]; int top; }seqstack,*pseqstack;
四、程序清單 #include
{1,0,1,1,1,0,1,1,1,1}, {1,0,0,0,0,1,1,1,1,1}, {1,0,1,0,0,0,0,0,1,1}, {1,0,1,1,1,0,0,1,1,1}, {1,1,0,0,1,1,0,0,0,1}, {1,0,1,1,0,0,1,1,0,1}, {1,1,1,1,1,1,1,1,1,1}}; int x; int y; }item;
item move[4]={{0,1},{1,0},{0,-1},{-1,0}};
typedef struct{ int x,y,d; }datatype;
typedef struct{ datatype data[1000]; int top; }seqstack,*pseqstack;
pseqstack init_seqstack() {
} pseqstack p; p=(pseqstack)malloc(sizeof(seqstack)); if(p) p->top=-1; return p;
int empty_seqstack(pseqstack p) {
}
int push_seqstack(pseqstack p,datatype x) {
}
int pop_seqstack(pseqstack p,datatype *x) { if(p->top==999) return 0; if(p->top==-1) return 1; else return 0; else {
} p->top++; p->data[p->top]=x; return 1;
} if(empty_seqstack(p)) return 0; else {
} *x=p->data[p->top]; p->top--; return 1; void destroy_seqstack(pseqstack *p) {
}
int mazepath(int maze[][n+2],item move[],int x0,int y0) {
pseqstack s; datatype temp; int x,y,d,i,j; if(*p) free(*p); *p=null; return;
temp.x=x0; temp.y=y0; temp.d=-1; s=init_seqstack(); if(!s) {
} push_seqstack(s,temp); while(!empty_seqstack(s)) {
pop_seqstack(s,&temp); x=temp.x; y=temp.y; d=temp.d+1; while(d<4) {
i=x+move[d]。x; j=y+move[d]。y; if(0==maze[i][j]) { temp.x=x; printf(“棧初始化失?。。?!”); return 0;
}
}
} temp.y=y; temp.d=d; push_seqstack(s,temp); x=i; y=j; maze[x][y]=-1; if(x==m&&y==n) {
} else d=0; while(!empty_seqstack(s)) {
} destroy_seqstack(&s); return 1; pop_seqstack(s,&temp); printf(“(%d,%d)<-”,temp.x,temp.y); else d++;
} destroy_seqstack(&s); return 0; int main() {
}
五、運行及調(diào)試分析 mazepath(maze,move,1,1); return 0;
六、課程設計總結(jié)等
在做實驗前,一定要將課本上的知識吃透,因為這是做實驗的基礎,否則,在做設計程序?qū)嶒灂r,這將使你做的難度加大,浪費寶貴的時間。使你事倍功半。做實驗時,一定要親力親為,務必要將每個步驟,每個細節(jié)弄清楚,弄明白,實驗后,還要復習,思考,這樣,你的印象才深刻,記得才牢固,否則,過后不久你就會忘得一干二凈,這還不如不做。通過這次程序設計的實驗,使我們學到了不少實用的知識,更重要的是,做實驗的過程,思考問題的方法,這與做其他的實驗是通用的,真正使我們們受益匪淺。
大數(shù)相乘
一、問題描述
本問題中,要求輸入兩個相對較大的正整數(shù),能夠通過程序計算出其結(jié)果
二、設計思路
1、輸入階段采用一維數(shù)組a[],b[] 在輸入階段當大數(shù)輸入時,大數(shù)a,b從高位到低位分別依次存入數(shù)組a[ ],b[ ]。
2、調(diào)用函數(shù)計算階段采用一維數(shù)組c[ ] 在計算過程中,由個位到高位依次計算各位的結(jié)果,并依次存入數(shù)組c[ ]中。
三、數(shù)據(jù)結(jié)構(gòu)定義
int x[n],y[n],z[n*n];
四、程序清單 #include
五、運行及調(diào)試分析
六、課程設計總結(jié)。
回顧起此次課程設計,至今我仍感慨頗多,的確,從從拿到題目到完成整個編程,從理論到實踐,可以學到很多很多的的東西,同時不僅可以鞏固了以前所學過的知識,而且學到了很多在書本上所沒有學到過的知識。通過這次課程設計使我懂得了理論與實際相結(jié)合是很重要的,只有理論知識是遠遠不夠的,只有把所學的理論知識與實踐相結(jié)合起來,從理論中得出結(jié)論,才能真正提高自己的實際動手能力和獨立思考的能力。
數(shù)據(jù)結(jié)構(gòu)課程設計心得體會800字篇二
課程設計報告的內(nèi)容
設計結(jié)束后要寫出課程設計報告,以作為整個課程設計評分的書面依據(jù)和存檔材料。設計報告以規(guī)定格式的電子文檔書寫,打印并裝訂,排版及圖,表要清楚,工整。 裝訂順序如下:封面、目錄、正文。正文包括以下7個內(nèi)容:
1、需求分析
陳述說明程序設計的任務,強調(diào)的是程序要做什么 ,需要什么結(jié)果、所能達到的功能。
2、概要設計
說明本程序中用到的所有抽象數(shù)據(jù)類型的定義,主程序的流程以及各程序模塊之間的層次(調(diào)用)關系。3.詳細設計
實現(xiàn)概要設計中定義的所有數(shù)據(jù)類型,對每個操作只需要寫出偽碼算法;對主程序和其他模塊也都需要寫出偽碼算法(偽碼算法達到的詳細程度建議為:按照偽碼算法可以在計算機鍵盤直接輸入高級程序設計語言程序);可采用流程圖、n s 圖進行描述,畫出函數(shù)和過程的調(diào)用關系圖。
4、調(diào)試分析
內(nèi)容包括:
a.調(diào)試過程中遇到的問題是如何解決的以及對設計與實現(xiàn)的回顧討論和分析; b.算法的時空分析(包括基本操作和其他算法的時間復雜度和空間復雜度的分析)和 改進設想;
c.經(jīng)驗和體會等。5.測試結(jié)果
列出你的測試結(jié)果,包括輸入和輸出。這里的測試數(shù)據(jù)應該完整和嚴格,最好多于需求分析中所列。
6、參考文獻
列出參考的相關資料和書籍。
封面格式如下:
數(shù)據(jù)結(jié)構(gòu)課程設計報告
班級:_____ _____ _____ _________
姓名:____________________
指導教師:___________________
成績:__________________________
信息工程學院
年月日
目錄
1、需求分析 ………………………………………………
22.概要設計………………………………………………2
3、詳細設計 ………………………………………………2
4、調(diào)試分析 ………………………………………………2
5、測試結(jié)果… ……………………………………………2 參考文獻 …………………………………………………6
附錄……………………………………………………
一、需求分析
二、概要設計
三、詳細設計
四、調(diào)試分析
五、測試結(jié)果
六、參考文獻
七、附錄
附錄為程序代碼!4
數(shù)據(jù)結(jié)構(gòu)課程設計心得體會800字篇三
一,課程題目
(算符優(yōu)先法計算算數(shù)表達式)以字符序列的形式從終端輸入語法正確的、不含變量的整數(shù)表達式。利用教材表3.1(p53)給出的算符優(yōu)先關系,實現(xiàn)對于算術四則混合運算(加、減、乘、除)表達式的求值。例如:7+(4-2)*3+12/2=19。注:按照四舍五入的方式將四則運算結(jié)果取整。
二,程序設計思想
在程序中分別設立一個運算符棧(optr 棧),用于存儲‘+’,‘-’,‘*’,‘/’,‘#’(‘#’用于判斷算術表達式結(jié)束),和一個操作數(shù)棧(opnd 棧),用于存放整數(shù),輸入算式后,先將數(shù)字與運算符分開入i棧,若為數(shù)字則先用轉(zhuǎn)換函數(shù)將char類型的數(shù)轉(zhuǎn)換為int型并進入操作數(shù)棧,若為運算符則根據(jù)教材表3.1(p53)給出的算符優(yōu)先級關系,判斷棧頂運算符和從鍵盤取得的運算符作優(yōu)先級比較,若取得的運算符優(yōu)先級高則進棧,直到取得運算符優(yōu)先級低的,則將操作數(shù)取出作operate運算后存入棧頂,反復操作知道遇到‘#’,則結(jié)束運算,輸出棧頂元素即為結(jié)果。 三,程序流程圖
四,程序關鍵代碼設計
本次程序設計共調(diào)用了12個方法分別是:
initnumstack,parseint,pushnum,popnum ,initcalstack,popcal ,pushcal,in,gettopcal,gettopnum,preced,operate。 其中
parseint方法
int parseint(char c[]){ int number[5],i; for(i=0;i<5;i++){
number[i]=(int)(c[i])-48; } i=10000*number[0]+1000*number[1]+100*number[2]+10 *number[3]+number[4]; return i; } 為將輸入的數(shù)字字符型轉(zhuǎn)換為整型的轉(zhuǎn)換函數(shù),通過ascall表的轉(zhuǎn)換關系,將輸入的字符型數(shù)字轉(zhuǎn)換為整型。在入棧前進行此方法,以便整型數(shù)的計算。 preced,operate函數(shù)
char preced(char a , char b){ char c[7]={+,-,*,/,(,),#}; char d[7][7]={ {>,>,<,<,,>}, {>,>,<,<,,>}, {>,>,>,>,,>}, {>,>,>,>,,>}, {<,<,<,<,,>,>,>, ,>,>}, {<,<,<,<,<, ,=}, }; int operate (int a,char theta,int b){ int c ; if (theta==+){
c=a+b; return c; } if (theta==-){
c=a-b; return c; } if (theta==*){
c=a*b; return c; } if (theta==/){
c=a/b; return c; } return 0; } 其中preced是判定運算符棧的棧頂運算符c1與讀入的運算符c2之間優(yōu)先關系函數(shù);opearte為進行二元運算acb的函數(shù),如果是編譯表達式,則產(chǎn)生這個運算的一組相應的指令并返回存放結(jié)果的中間變量名;如果是解釋執(zhí)行表達式,則直接進行該運算,并返回運算結(jié)果。 五,程序源代碼以及運行結(jié)果
#include
int in(char c,char s[]){ int i; for(i=0;i
if(c==s[i])
return 1;
return 0; }
char gettopcal(sqlcal &s){ char c; c=*(-1); return c; } int gettopnum(sqlnum &s){ int c; c=*(-1); return c; } char preced(char a , char b){ char c[7]={+,-,*,/,(,),#}; char d[7][7]={ {>,>,<,<,,>}, {>,>,<,<,,>}, {>,>,>,>,,>}, {>,>,>,>,,>}, {<,<,<,<,,>,>,>, ,>,>}, {<,<,<,<,<, ,=}, } w w ; if(a==+){
if(b==+){
return d[0][0];}
if(b==-){
return d[0][1];}
if(b==*){
return d[0][2];}
if(b==/){
return d[0][3];}
if(b==(){
return d[0][4];}
if(b==)){
return d[0][5];}
if(b==#){
return d[0][6];} } if(a==-){
if(b==+){
return d[1][0];}
if(b==-){
return d[1][1];}
if(b==*){
return d[1][2];}
if(b==/){
return d[1][3];}
if(b==(){
return d[1][4];}
if(b==)){
return d[1][5];}
if(b==#){
return d[1][6];} } if(a==*){
if(b==+){
return d[2][0];}
if(b==-){
return d[2][1];}
if(b==*){
return d[2][2];}
if(b==/){
return d[2][3];}
if(b==(){
return d[2][4];}
if(b==)){
return d[2][5];}
if(b==#){
return d[2][6];} } if(a==/){
if(b==+){
return d[3][0];}
if(b==-){
return d[3][1];}
if(b==*){
return d[3][2];}
if(b==/){
return d[3][3];}
if(b==(){
return d[3][4];}
if(b==)){
return d[3][5];}
if(b==#){
return d[3][6];} } if(a==(){
if(b==+){
return d[4][0];}
if(b==-){
return d[4][1];}
if(b==*){
return d[4][2];}
if(b==/){
return d[4][3];}
if(b==(){
return d[4][4];}
if(b==)){
return d[4][5];}
if(b==#){
return d[4][6];} } if(a==)){
if(b==+){
return d[5][0];}
if(b==-){
return d[5][1];}
if(b==*){
return d[5][2];}
if(b==/){
return d[5][3];}
if(b==(){
return d[5][4];}
if(b==)){
return d[5][5];}
if(b==#){
return d[5][6];} } if(a==#){
if(b==+){
return d[6][0];}
if(b==-){
return d[6][1];}
if(b==*){
return d[6][2];}
if(b==/){
return d[6][3];}
if(b==(){
return d[6][4];}
if(b==)){
return d[6][5];}
if(b==#){
return d[6][6];} } return 0; } int operate (int a,char theta,int b){ int c ; if (theta==+){
c=a+b; return c; } if (theta==-){
c=a-b; return c; } if (theta==*){
c=a*b; return c; } if (theta==/){
c=a/b; return c; } return 0; } void main(){ sqlcal optr; sqlnum opnd; char c,d[5]={0,0,0,0,0}; int f=0; char op[]={+,-,*,/,(,),#}; initcalstack(optr); initnumstack(opnd); printf(“請輸入算式并在尾部添加一個#號n”); c=getchar(); pushcal(optr,#); while(c!=#||gettopcal(optr)!=#) { if (!in(c,op))
{
d[0]=d[1];
d[1]=d[2];
d[2]=d[3];
d[3]=d[4];
d[4]=c;
c=getchar(); f=1;
}
else
{
if(f==1){
pushnum(opnd,parseint(d));
d[0]=0;d[1]=0;d[2]=0;d[3]=0;d[4]=0;
f=0;
}
switch(preced(gettopcal(optr),c))
{
case<:
pushcal(optr,c);
c=getchar();
break;
case=:
popcal(optr);
c=getchar();
break;
case>:
char theta;int a;int b;
theta=popcal(optr);
b=popnum(opnd);
a=popnum(opnd);
pushnum(opnd,operate(a,theta,b));
break;
}
} } printf(“%dn”,gettopnum(opnd)); }
程序運行結(jié)果: 六,心得體會
通過這次編程,我發(fā)現(xiàn)很多編程過程中的不足與問題,很多問題由于考慮不全面,導致程序運行失敗。還有一些小問題,比如字母的大小寫,括號的遺漏,語法書寫錯誤等等一些基礎錯誤,也是讓我體會很深寫程序要謹慎仔細。