




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、The Need for Data Structures,Data structures organize data more efficient programs. More powerful computers more complex applications. More complex applications demand more calculations. Complex computing tasks are unlike our everyday experience.,Organizing Data,Any organization for a collection of
2、records can be searched, processed in any order, or modified. The choice of data structure and algorithm can make the difference between a program running in a few seconds or many days.,Efficiency,A solution is said to be efficient if it solves the problem within its resource constraints. Space Time
3、 The cost of a solution is the amount of resources that the solution consumes.,有效率的,资源限制,Selecting a Data Structure,Select a data structure as follows: Analyze the problem to determine the resource constraints a solution must meet. Determine the basic operations that must be supported. Quantify the
4、resource constraints for each operation. Select the data structure that best meets these requirements.,Some Questions to Ask,Are all data inserted into the data structure at the beginning, or are insertions interspersed with other operations? Can data be deleted? Are all data processed in some well-
5、defined order, or is random access allowed?,Data Structure Philosophy,Each data structure has costs and benefits. Rarely is one data structure better than another in all situations. A data structure requires: space for each data item it stores, time to perform each basic operation, programming effor
6、t.,原则、方法,Goals of this Course,Reinforce the concept that costs and benefits exist for every data structure. Learn the commonly used data structures. These form a programmers basic data structure toolkit. Understand how to measure the cost of a data structure or program. These techniques also allow y
7、ou to judge the merits of new data structures that you or others might invent.,Abstract Data Types,Abstract Data Type (ADT): a definition for a data type in terms of a set of values and a set of operations on that data type. Each ADT operation is defined by its inputs and outputs. Encapsulation: Hid
8、e implementation details.,Data Structure,A data structure is the physical implementation of an ADT. Each operation associated with the ADT is implemented by one or more subroutines in the implementation. Data structure usually refers to an organization for data in main memory. File structure is an o
9、rganization for data on peripheral storage, such as a disk drive.,Logical vs. Physical Form,Data items have both a logical and a physical form. Logical form: definition of the data item within an ADT. Ex: Integers in mathematical sense: +, - Physical form: implementation of the data item within a da
10、ta structure. Ex: 16/32 bit integers, overflow.,Data Type,ADT: Type Operations,Data Items: Logical Form,Data Items: Physical Form,Data Structure: Storage Space Subroutines,Problems,Problem: a task to be performed. Best thought of as inputs and matching outputs. Problem definition should include cons
11、traints on the resources that may be consumed by any acceptable solution.,Problems mathematical functions A function is a matching between inputs (the domain) and outputs (the range). An input to a function may be single number, or a collection of information. The values making up an input are calle
12、d the parameters of the function. A particular input must always result in the same output every time the function is computed.,Algorithms and Programs,Algorithm: a method or a process followed to solve a problem. A recipe. An algorithm takes the input to a problem (function) and transforms it to th
13、e output. A mapping of input to output. A problem can have many algorithms.,Algorithm Properties,An algorithm possesses the following properties: It must be correct. It must be composed of a series of concrete steps. There can be no ambiguity as to which step will be performed next. It must be compo
14、sed of a finite number of steps. It must terminate. A computer program is an instance, or concrete representation, for an algorithm in some programming language.,-finiteness: Algorithm must complete after a finite number of instructions have been executed. -absence of ambiguity: Each step must be clearly defined, having only one interpretation. -definition of sequence: Each step must have a unique defined preceding & succeeding
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 【正版授权】 ISO 17201-2:2025 EN Acoustics - Noise from shooting ranges - Part 2: Calculation of muzzle blast
- 2025至2030中国男士钻石戒指行业深度研究及发展前景投资评估分析
- 2025至2030中国电子书阅读器行业发展研究与产业战略规划分析评估报告
- 2025至2030中国生态度假农庄行业市场发展现状及发展趋势与投资报告
- 2025至2030中国玉石行业市场占有率及投资前景评估规划报告
- 2025至2030中国特种纸浆行业市场占有率及投资前景评估规划报告
- 百日培训课件
- 培养孩子良好学习习惯的数字策略研究
- ICU护理文件书写培训
- 维修拆卸技能培训课件
- 科创板开户测试题及答案
- 内科护理学消化性溃疡
- 北京市第一零一中学2023-2024学年高一下学期期末考试地理试题(解析版)
- 中小学暑期安全教育班会课件
- DB43-T 2988-2024 再生稻高产栽培技术规程
- 2024年荆州市荆发控股集团招聘考试真题
- 慢病智能监测-洞察及研究
- 部门预算支出经济分类科目
- 2025年内蒙古呼伦贝尔农垦集团有限公司招聘笔试冲刺题(带答案解析)
- 《健康管理师》职业技能竞赛考试题(附答案)
- 在非到发线上接发列车站内无空闲线路时的接发列车39课件
评论
0/150
提交评论