- 1
- 0
- 约1.64万字
- 约 51页
- 2018-06-09 发布于福建
- 举报
structure探讨一群相关的资料的的资料表示方
CHAPTER 1 CHAPTER 1BASIC CONCEPT Data Structure What is data structure? Ans. Data structure探討一群相關資料的資料表示方 法與資料運作方法 目的 : 使用最有效率的方式,對一群相關資料進行處理 如何設計 : 1. 找出對該資料的各種運算 2. 考慮最適當的Data Structure,使得各種運算的 效率最佳 3. 設計一個完整的Algorithm How to create programs Requirements: What inputs, functions, and outputs Analysis: bottom-up vs. top-down Design: data objects and operations Refinement and Coding Verification Program Proving Testing Debugging Algorithm DefinitionAn algorithm is a finite set of instructions that accomplishes a particular task. Criteria Input: zero more quantities are externally supplied. Output: at least one quantity is produced. definiteness: clear and unambiguous finiteness: terminate after a finite number of steps effectiveness: instruction is basic enough to be carried out Algorithm One distinguishes between an algorithm and a program, the latter of which does not have to satisfy the fourth condition (Finiteness). For example, we can think of an operating system that continues in a wait loop until more jobs are entered. 在已排序的資料中找值18 Sequential Search 第7次找到 Binary Search 第3次找到 Translating a Problem into an Algorithm Problem Devise a program that sorts a set of n= 1 integers Solution I From those integers that are currently unsorted, find the smallest and place it next in the sorted list Solution II for (i= 0; i n; i++){ Examine list[i] to list[n-1] and suppose that the smallest integer is list[min]; Interchange list[i] and list[min]; } Translating a Problem into an Algorithm Solution III Data Type Data TypeA data type is a collection of objects and a set of operations that act on those objects. Example of int Objects: 0, +1, -1, ..., Int_Max, Int_Min Operations: arithmetic(+, -, *, /, and %), testing (equality/inequality), assigns, functions Data encapsulation and Data abstraction Data encapsulation or Information hiding是把資料物件的內部程式碼內容隱藏不被外部的使用者知道 目的 : 1. 讓往後可能的修改能夠局限在此程式單元之中 2. 讓程式單元不需隨著ADT內部的表示方式的改 變而修改外部的使用方式3
您可能关注的文档
最近下载
- QC成果提高叠合板接缝施工质量一次验收合格率(2024.6.24).pdf VIP
- 2025年日语N2水平测试模拟试卷:日语N2考试全真模拟试题及答案解析.docx VIP
- 云南2025年春季高考信息技术真题-试题.pdf VIP
- 辽宁省中考语文专题复习知识清单七常考近义词辨析课件.pdf VIP
- 输油管道初步设计.doc VIP
- 2025年山西中考语文试题及答案 .pdf VIP
- 2025年日语N2水平测试模拟试卷:日语N2考试模拟试题及答案解析.docx VIP
- (统编2026新教材)三年级道法下册第1课《我们的生活越来越幸福》课件.pptx
- 呼吸衰竭临床诊治.ppt VIP
- Lecture 2 manuscript form 《英语写作手册》丁往道编 外研社.pptx VIP
原创力文档

文档评论(0)