版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Data structureBasic ConceptDataThe set of symbols which can be recognized, stored and processed by the computer.Is the carrier of information.ExamplesInteger or real. (processed by digital processing programs)Source program.( processed by compiler)Images. (processed by image processing programs)Basi
2、c ConceptData elementThe basic unit to compose a data.Can also be referred as element, record, node or vertex.Data itemData element is composed by data items.Is the smallest unit discussed in data structure.Data item is also called domain or field.Basic ConceptData structureThe set of data elements
3、which have some relationship between each other.Logical structureThe logical relationship between each other.Storage structureStorage map of logical structure in storage.Basic ConceptThe logical structure can be formally represented as : L = ( N, R )N: the set of the node. R: the set of relation on
4、N.ExamplesL = ( N, R )N = a0, a1, a2 R = r r = ( a0, a1 ), ( a0, a2 ) Basic ConceptLet L=( N, R ) is a logical structure, R= r ,If a, bN, and relation ( a, b )R, then :a is predecessor node of bb is successor node of ba and b are adjacent nodes If a node dont have predecessor, it is called start nod
5、e. If a node dont have successor, it is called final node.If a node have both predecessor and successor, it is called internal node.Basic ConceptLogical structure of dataLiner structureTree structureGraph structureSet structureBasic StructureLinear StructureThere is only one start node and final nod
6、e, every internal node have one and only one predecessor and successor.None linear structureNodes in the structure can have more than one predecessor and successor.Basic conceptEvery line represents a node (element), every line is composed of 9 domains (data items). The first line is start node, the
7、 last line is final node. The lines between the first line and last line are internal nodes.The logical structure of a table is linear structure.Basic conceptStorage structure of dataThe mapping of data elementThe mapping of relationshipThe mapping of data elementrepresenting a data element using bi
8、nary bits. (321)10 = (101000001)2 A = (001000001)2Basic conceptMapping of relationshipSequential mappingrepresenting successor relationship using relative storage location.Chaining mappingrepresenting successor relationship using pointer. x ystorage structure only contains data element information.
9、No additional info. y xBesides data element information, there is additional information in storage structure to represent the logical structure.Basic ConceptAlgorithm: a limit sequence of instructions used to solve some problems.A algorithm can be described using nature language or pseudo programmi
10、ng language.An algorithm must meet the following 5 requirements: (1) finite (2) definitude (3) input (4) output (5) feasibilityBasic conceptFinite: terminate after a finite number of steps Definitude: clear and unambiguous Same input will get same output.Input: one algorithm can have zero or many in
11、put data. The input data get from definite object set.Output: an algorithm can have one or many output. The output has specific relationship with input.Feasibility: instruction is basic enough to be carried outBasic conceptThe principles of designing algorithm CorrectnessReadabilityrobustEfficient a
12、nd low storage requirement.Basic conceptCorrectness: for all legal input, after finite times of execution, the algorithm will generate correct result.Readability : easier for designer and others to read, understand, update and reuse. Robust: When input illegal data, the algorithm can react properly.
13、Efficient and low storage requirement: efficiency means the execution time of the algorithm; Amount of storage means the maximum storage requirement. Both of them related to the scale of the problem.Basic conceptCorrection of the algorithmThere is no grammar mistakes in the program.The program can o
14、utput correct results for several groups of input data. The program can output required output for typical ,selected input. The program can output required output for all legal input.Basic ConceptPerformance Analysis Analysis after execution(machine independent)Must execute the programAffected by so
15、me other factorsAnalysis before executionspace complexity: storage requirementtime complexity: computing timeBasic conceptFactors affect execution timeThe strategy selected by the algorithmThe scale of the problemThe programming languageThe machine language generated by the compiler.The speed the co
16、mputer executing instructions.It is not good for evaluating the efficiency of an algorithm based on absolute time unitBasic ConceptWithout considering the software and hardware factors affecting the efficiency of the algorithm, “the running workload ” of a specific algorithm depends only on the scal
17、e of the problem (represented using n). Or it is the function of the scale of the problem. For example, with the increment of the scale of the problem, the increasing ratio of the execution time is the same as f(n), then we denote it as: T (n) = O( f (n) )T (n) is called time complicity of the algor
18、ithmBasic conceptAlgorithm=control structures + basic operationsNormally the execution times of some basic operations are use as the time measurement of complicity of the algorithm.void mult(int an, int bn, int(&c)nn ) for (i=0; in; +i) for (j=0; jn; +j) cij = 0; for (k=0; kn; +k) cij += aik*bkj; /for /multO(n3)Basi
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2026学年河南省开封市九年级(上)期中历史试卷(含答案)
- 2025-2026学年八年级英语上册期中复习(Unit1-4语法)
- 光伏发电厂培训课件
- 自检互检制度培训
- 翻译古诗题库及答案
- 二建年真题及答案
- 《公务员法》考试题库500题(含答案)
- 《茶艺与茶文化》 专业基础知识考试题库(含答案)
- 小学五年级语文上册语文园地中难点突破案例分析课件
- 【初中 物理】二力平衡课件-2025-2026学年人教版物理八年级下册
- 拜师礼现场课件
- 2025年秋人教版(2024)初中美术七年级上册期末知识点复习卷及答案
- 2025年高校行政面试题及答案
- 酒店合并协议书范本
- 调车服务合同范本
- 2026年计算机四级(Linux工程师实务)考试题及答案
- 2025年新《中国传统文化》考试复习题(附答案)
- 行车搬迁改造协议书
- 辽宁省辽西重点高中2025-2026学年高一上学期11月期中考试数学试题(原卷版)
- 甘肃省庆阳市七区2024-2025学年高一上学期期末联考语文试题
- 人教版小升初考试数学试卷(含解析)重庆市渝北区鲁能巴蜀小学2025年
评论
0/150
提交评论