数据结构实验报告图的基本运算及飞机换乘次数最少问题

上传人:沈*** 文档编号:147789751 上传时间:2022-09-03 格式:DOC 页数:19 大小:226.02KB
收藏 版权申诉 举报 下载
数据结构实验报告图的基本运算及飞机换乘次数最少问题_第1页
第1页 / 共19页
数据结构实验报告图的基本运算及飞机换乘次数最少问题_第2页
第2页 / 共19页
数据结构实验报告图的基本运算及飞机换乘次数最少问题_第3页
第3页 / 共19页
资源描述:

《数据结构实验报告图的基本运算及飞机换乘次数最少问题》由会员分享,可在线阅读,更多相关《数据结构实验报告图的基本运算及飞机换乘次数最少问题(19页珍藏版)》请在装配图网上搜索。

1、inspecci de seguretat integral, informar sobre la comprovaci, sistema de cstig estricte, per trobar el problema, posar-lo a persones, rectificaci. Membres claus de les responsabilitats dequip de gesti de seguretat sn els segents: 1, projecte (1) projecte de director s el responsable dEnginyeria de s

2、eguretat i eren directament responsable. (2) tecnologia de seguretat dirigides les organitzacions dna les baixes. (3) responsable dorganitzar laplicaci de mesures de seguretat. (4) qualificat dequipament de maquinria construcci, lnies temporals electricitat per organitzar la inspecci i lacceptaci, a

3、bans dutilitzar. (5), responsables de la construcci civil, regles normalitzar i civilitzada lloc de construcci. (6) sobre una base regular per organitzar la regulaci de la seguretat operaci, treballadors de leducaci en les operacions illegals i seguretat organitzativa violacions (7) comprova com a m

4、nim un cop per setmana,. Comprovar al voltant de, entorn de treball i va trobar amagat a prendre mesures immediates per eliminar abans que pugui treballar. (6) un accident o gaireb enfonsat informar immediatament al responsable del projecte i per protegir el lloc, participar en la investigaci. Segur

5、etat cinc objectius (1) seguretat construcci estndard lloc ndex de qualitat: normes de seguretat complet lloc activitats, normes davaluaci final dany. (2) mesures de control de seguretat: no seriosament lesionat dins i fora el personal de lloc de construcci durant el perode de construcci (ambds incl

6、osos) o ms accidents, malaltia professional taxa de 0; eliminar lesions de transport (o ms) major sinistralitat, accident explosius, accidents de foc, enverinament massiu i control acumulativa prdues econmiques en anys per completar la construcci del valor de 0,06 per mil. Sis, suport de construcci

7、i anti-lliscant bloc suport de disposici i control lliscant sortir fixa comentaris tenint llosa amb enviar placa jssera elevaci i set abans de la construcci preparat per backfill pendent 1, con en lloc, grues i llarga ruta de camions ha de ser suau, pis, no denfonsament, aix com no per retardar laix

8、ecament de temps, fent construcci suau. 2, fer front i tapa de formig estrep del perode de manteniment. 3, llosa de formig periode de curaci. 4, primer esbrinar totes les vores de placa feix i rodaments de goma, goma dna suport a lembarcador amb pegament epoxi a. 5, llest per controlar lexpansi de J

9、unta, 4cm i estores de jsseres de placa de ferro, Pau gruixut - 8mm 15mm. 6, durant tot el procs de construcci, atenci ha de prestar productes semielaborats i acabats (com el sl, placa jsseres, Cap, afrontament i aix successivament) en manteniment. 7, aixecament de tot el personal ha justament distr

10、ibut, cada procs hauria de ser sota el comandament dalg. Vuit i seleccioneu mecnica Sha Yixi pont i oli desprmer apurat , pont, i oli espremut apurat II, pont i final de cavallof the situation, the cultivation of strategic thinking and historical thinking, dialectical thinking, creative thinking, th

11、e bottom line of thinking, a profound analysis of the new trend of the development and change of international and domestic situation, facing opportunities and challenges, and constantly enhance the predictability. At the same time, to in-depth investigation and study, a profound understanding of th

12、e characteristics of current stage of Chinas development and in different places and different fields of specific performance, find Chinas development is facing the contradictions and problems, understand the expectations of the people, make our Decisions and work more in line with the actual more i

13、n line with the wishes of the people. Adhere to the partys ideological line, we must insist on emancipating the mind, seeking truth from facts and keeping pace with the times, pragmatic, the core of which is to seek truth from facts. This is on the thought course of the party spirit, the practical r

14、equirements of a highly generalization. Development of practice is endless, understanding the truth is endless, theory and practice innovation is endless. Adapt to the demands of the age development, with many new historical features in the great struggle, winning the completion of a comprehensive w

15、ell-off society, there is an urgent need for us to greater courage and wisdom, and actively explore, bold experiment, study the new situation, summarize new experience, continue to promote Theoretical innovation based on practice, scientific and technological innovation, cultural innovation, system

16、innovation and other aspects of innovation, with new ideas, ideas and initiatives, efforts to solve the economic construction, political construction, cultural construction, social construction, ecological civilization construction and the construction of the party faces new problems, and constantly

17、 open up the cause of socialism with Chinese characteristics development in the new situation. How to understand the cause of socialism with Chinese characteristics, one of five overall cloth? the constitution will be the overall layout of the cause of socialism with Chinese characteristics determin

18、ed for the economic construction, political construction, cultural construction, social construction, ecological civilization construction of one of the five. Economic construction is to the development of the socialist market economy and political construction is to develop socialist democratic pol

19、itics and culture construction is to develop advanced socialist culture, social construction is to building a socialist harmonious society, the construction of ecological civilization is to building a socialist ecological civilization. Partys eighteen years, the Central Committee of the Communist Pa

20、rty of China according to the new requirements of the changes in the situation and tasks of development, made a four overall strategic layout, and puts forward the innovation, coordination, green,thrift of excellent traditional and style lack deep of understanding, one-sided think in now of good sit

21、uation Xia, economic smooth more fast development, and reform made major progress, and people living significantly improve, and social the career made new progress, no necessary always hard has, no awareness to China also has many poverty area, and also has many poverty population of exists, more li

22、ving improve has, more need keep hard of style. Three is not strictly honest. Total thought units is a water sector, clean self-discipline away from himself too far, no real processing good living of improve and hard, and thrift excellent traditional of relationship, no effective do comply with Cons

23、titution and party of regulations must from I do up, no right mercy good bitter Le, and wealth of relationship, no right awareness to in comply with Constitution and party of regulations aspects everyone has accountability. Four, future direction and improvement measures 1, belief and faith, strengt

24、hen party spirit. One is to firmly establish the noble ideals of struggle for the ideals of communism, communist struggle for life, ready to sacrifice everything for the party and the people. Second is to continuously improve the quality and standard of political, conscientiously study Deng Xiaoping

25、 theory and three represents important thought and the scientific Outlook on development, implement the partys basic program for the primary stage of socialism, adhere to the correct political orientation, maintain highly consistent with the CPC Central Committee, is good at theories of socialism wi

26、th Chinese characteristics to analyze and solve problems. Third, strengthening the party spirit and the world transformation, perseverance of the party Constitution, relive Party vows to establish correct world Outlook, Outlook on life and the world, practically embodies ideals and beliefs into acti

27、on, combine lofty ideals and practical activities, transforming the objective world, actively participate in the great practice of building socialism with Chinese characteristics. 2, keep the purpose in concept, changing the style of work. First, keep in mind that the purpose of serving, adhere to a

28、ssuming power for the people, keep in mind the people and care about people, and the joys and sorrows of the masses, .According to city discipline, and municipal organization Department requirements, today we held implement implementation independent Commission against corruption guidelines effectiv

29、e strengthening led cadres style construction topic democratic life, main task is close contact thought, and work actual, control check district Standing Committee team and the personal in implementation independent Commission against corruption guidelines Shang exists of problem, in-depth carried o

30、ut criticism and self-critical, further clear rectification direction and measures, effective enhanced clean politics of consciousness and initiative, firm set good of ruling image. Before the meeting, the way we take surveys solicited a views, combed, related to team building实验报告实验名称:二叉树的基本操作及哈夫曼编码

31、译码系统的实现 一、问题描述1.实验目的和要求a.创建一棵二叉树,实现先序、中序和后序遍历一棵二叉树,计算二叉树结点个数等操作。b.哈夫曼编码/译码系统。2.实验任务:能成功演示二叉树的有关运算,运算完毕后能成功释放二叉树所有结点占用的系统内存3. 实验内容:a. 创建一棵二叉树;先序、中序和后序遍历这棵二叉树;计算二叉树结点个数b. 哈夫曼编码译码系统二 程序设计三 .程序代码主函数:#includeCreateHfmTree.h#include#includeusing namespace std;void main() coutendlendl; coutM-Show this menu

32、.endl; coutB-Build up tree: read character set and frequency of each character, build up hfm tree.endl; coutT-Trace the tree: PreOrder and InOrder the BTree.endl; coutE-Generate code: According to the builded up hfm tree, generate the codes for all character.endl; coutC-Encode: Input arbitary string

33、 formed by characters which have been generated code, utilize the codes to ecode and print the result of encoding.(end with #)endl; coutD-Translate: read codefile.txt, utilize the exisiting hfm tree to translate code and restore code Into hardware file result.txt.endl; coutP-Print: Print the content

34、s of file: textfile.txt, codefile.txt, result.txt on the screen.endl; coutX-Exit: Exit this system.endl; cout-Delete: Delete character set, character frequencies, codes and HfmTree if they are exist.endl; int w100; char data100; int n; char choice; int i,j; HfmTree hfm; HfmNode* ht; HfmCode* hc;char

35、 s1000;repeat1:coutendl; coutchoice;coutendl;if(choice=b | choice=B) coutn; cout-endl; coutAllocating the memory.endl; coutAllocating the complete.endl; cout-endl; coutPlease input all the elementary codes: endl; for(int i=0;idatai; coutPlease input all the Frenquencies: endl; for(i=0;iwi; hfm=Creat

36、eHfmTree(w,data,4); goto repeat1; if(choice=t | choice=T) couthfm; hfm.PreOrder(Visit); couthfm; hfm.InOrder(Visit); goto repeat1; if(choice=e | choice=E) coutGenerating code.endl; ht=new HfmNode2*n-1; hc=new HfmCoden; hfm.Grcode(w,data,n,ht,hc); for( i=0;in;i+) couthti.word:; for( j=hci.start+1;jn;

37、j+) couthci.bitj; coutendl; coutCode Generate complete.endl; goto repeat1; if(choice=c | choice=C)coutPlease input the article that you want to code: ch;si+=ch;if(ch=#)break;int length=i; ofstream outf(testfile.txt); if(!outf) coutCant Open the file!; return; i=0; while(si!=#) outf.put(si); i+; outf

38、.close();coutendl; coutResult of encoding: ; hfm.Encode(ht,hc,n,testfile.txt,codefile.txt);coutendl;coutEncoding complete.endlendl;goto repeat1;if(choice=d | choice=D)coutStarting translating code.endl;coutResult:;hfm.Decode(ht,n,codefile.txt,resultfile.txt);coutendl;goto repeat1;if(choice=p | choic

39、e=P)cout-testfile.txt-endl; hfm.Print(testfile.txt);cout-endl; coutendlendl; cout-codefile.txt-endl; hfm.Print(codefile.txt);cout-endl; coutendlendl; cout-resultfile.txt-endl; hfm.Print(resultfile.txt);cout-endl; coutendlendl;goto repeat1; if(choice=x | choice=X)return;if(choice=-)hfm.Clear();coutDe

40、lete All.endl;goto repeat1;二叉树类:#includeBTNode.h#includeseqqueue.htemplateclass BinaryTreepublic:BinaryTree() root=NULL; bool IsEmpty() const; void Clear(); bool Root(T& x) const; void MakeTree(const T& x,BinaryTree& left,BinaryTree& right); void MakeTree(const T& x,const T& y,BinaryTree& left,Binar

41、yTree& right);void BreakTree(T& x,BinaryTree& left,BinaryTree& right); void PreOrder(void (*Visit) (T& x); void InOrder(void (*Visit) (T& x); void PostOrder(void (*Visit) (T& x); void LevalOrder(); int Size();protected:BTNode *root;private:void Clear(BTNode* t);void PreOrder(void (*Visit) (T& x),BTN

42、ode *T); void InOrder(void (*Visit) (T& x),BTNode *T); void PostOrder(void (*Visit) (T& x),BTNode *T); void LevalOrder(BTNode* t); int Size(BTNode* t);templatebool BinaryTree:IsEmpty() constreturn root=NULL;templatevoid BinaryTree:Clear(BTNode* t) if(t) if(t-lChild) Clear(t-lChild); if(t-rChild) Cle

43、ar(t-rChild); delete t; t=NULL; templatevoid BinaryTree:Clear()Clear(root);template bool BinaryTree:Root(T &x) const if (root)x=root-element;return true;else return false;template void BinaryTree:MakeTree(const T& x, BinaryTree& left, BinaryTree& right) couthere in BinaryTree:MakeTree.endl; if(root

44、| &left=&right) return;root=new BTNode(x,left.root,right.root);left.root=right.root=NULL;template void BinaryTree: MakeTree(const T& x,const T& y,BinaryTree& left,BinaryTree& right) if(root | &left=&right) return;root=new BTNode(x,y,left.root,right.root);left.root=right.root=NULL;template void Binar

45、yTree:BreakTree(T &x,BinaryTree&left, BinaryTree& right) couthere in BinaryTree:BreakTree.element;left.root=root-lChild; right.root=root-rChild;delete root;root=NULL;templatevoid Visit(T& x)coutx ;template void BinaryTree:PreOrder(void (*Visit)(T& x) cout先序遍历为: ;PreOrder(Visit,root);coutendl;templat

46、evoid BinaryTree:PreOrder(void (*Visit) (T& x),BTNode *t) if(t)Visit(t-element);PreOrder(Visit,t-lChild);PreOrder(Visit,t-rChild);template void BinaryTree:InOrder(void (*Visit)(T& x) cout中序遍历为: ;InOrder(Visit,root);coutendl;template void BinaryTree:InOrder (void (*Visit)(T& x),BTNode* t) if (t)InOrd

47、er(Visit,t-lChild);Visit(t-element);InOrder(Visit,t-rChild);template void BinaryTree:PostOrder(void (*Visit)(T& x) cout后序遍历为: ;PostOrder(Visit,root);coutendl;template void BinaryTree:PostOrder(void (*Visit)(T& x),BTNode* t) if (t) PostOrder(Visit,t-lChild);PostOrder(Visit,t-rChild);Visit(t-element);

48、template void BinaryTree:LevalOrder(BTNode* t) SeqQueueBTNode* q(100); if(!t) return ; q.EnQueue(t); while(!q.IsEmpty() t=q.DeQueue(); coutelementlChild) q.EnQueue(t-lChild); if(t-rChild) q.EnQueue(t-rChild); coutendl; templatevoid BinaryTree:LevalOrder()LevalOrder(root);templateint BinaryTree:Size(

49、BTNode* t) if(!t) return 0; elsereturn Size(t-lChild)+Size(t-lChild)+1;templateint BinaryTree:Size()return Size(root);二叉树结点类:#includetemplatestruct BTNode BTNode() lChild=rChild=NULL; BTNode(const T& x) element=x; lChild=rChild=NULL; BTNode(const T& x,BTNode* l,BTNode* r) element=x; lChild=l; rChild

50、=r; BTNode(const T& x,const T& y,BTNode* l,BTNode* r) element=x; word=y; lChild=l; rChild=r; T element;T word; BTNode *lChild,*rChild; ;哈夫曼树类:#includeBinaryTree.h #includestruct HfmNodechar word; int weight; int parent; int lchild; int rchild;struct HfmCode int bit10000; int start; int weight;templa

51、teclass HfmTree:public BinaryTreepublic:operator T()const return weight; T getW() return weight; void putW(const T& x) weight=x; void SetNull() root=NULL; void Grcode(T w,char c,int n,HfmNode ht,HfmCode hc);void Encode(HfmNode ht,HfmCode hc,int count,char *record,char *tranvers);void Decode(HfmNode

52、ht,int count,char *in,char *fout);void Print(char *in);private: T weight;templatevoid HfmTree:Grcode(T w,char c,int n,HfmNode ht,HfmCode hc) int m1,m2,x1,x2;char d1,d2; int i,j; for(i=0;i2*n-1;i+) if(in) hti.weight=wi; hti.word=ci; else hti.weight=0; hti.word=#; hti.parent=0; hti.lchild=-1; hti.rchild=-1; for(i=0;in-1;i+) m1=m2=1000; x1=x2=0; d1=d2=#; for( j=0;jn+i;j+) if(htj.weightm1 & htj.parent=0) m2=m1; m1=htj.weight; d2=d1; d1=htj.word; x2=x1;x1=j; else if(htj.weight

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!