数据结构:对计算机内存中数据的一种安排。包括:数组、链表、栈、二叉树、哈希表等。
算法:对数据结构中的数据进行各种处理,例如查找特定项,排序等。
解决问题:现实世界中的数据存储,以前是用索引卡片(一叠卡片)来存储数据的,现在如果想用计算机来代替索引卡片(凡是用索引卡片的都可以用计算机代替),将会出现一些问题:
• How would youstore the datain your computer’s memory? --建模
• Would your method work for a hundred file cards? A thousand? A million? --扩容
• Would your method permit quickinsertionof new cards anddeletionof old ones?
--插入、删除
• Would it allow forfast searchingfor a specified card? --查找
• Suppose you wanted to arrange the cards in alphabetical order. How would you sort them? --排序
程序员的工具
有些数据结构只会在编程语言中用到,而不会被用户直接使用。
现实世界的建模
数据结构的特性(围绕查找、增加、删除的性能)

抽象数据结构:除了数组之外的数据结构。
算法的概述:插入删除查找,迭代查询、排序
Summary
• A data structure is the organization of data in a computer’s memory or in a disk file.
• The correct choice of data structure allows major improvements in program efficiency.
• Examples of data structures are arrays, stacks, and linked lists.
• An algorithm is a procedure for carrying out a particular task.
• In Java, an algorithm is usually implemented by a class method.
• Many of the data structures and algorithms described in this book are most often used to build databases.(数据库的原理看来不简单啊)
• Some data structures are used as programmer’s tools: They help execute an algorithm.
• Other data structures model real-world situations, such as telephone lines running between cities.(电话线网和数据结构有什么关系?也涉及到查询)
• A database is a unit of data storage composed of many similar records.
• A record often represents a real-world object, such as an employee or a car part.
• A record is divided into fields. Each field stores one characteristic of the object described by the record.
• A key is a field in a record that’s used to carry out some operation on the data.
For example, personnel records might be sorted by a LastName field.
• A database can be searched for all records whose key field has a certain value.
This value is called a search key.索引
关键字:当查询一条记录时,所使用的那个字段被称为(索引)关键字。
网友评论