Download 專業英文導讀 Chapter 11 End-Chapter Materials Key Terms Key

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

B-tree wikipedia , lookup

Linked list wikipedia , lookup

Array data structure wikipedia , lookup

Transcript
專業英文導讀
Chapter 11 End-Chapter Materials
Key Terms
Key Term
Definition
array
Definition: A fix-sized, sequenced collection
of elements of the same data type.
Example: An array is a sequenced collection
of elements, normally of the same data type,
although some programming languages
accept arrays in which elements are of
Page
#
296
different types.
data structure
Definition: The syntactical representation of
data organized to show the relationship
among the individual elements.
295
Example: A data structure uses a collection of
related variables that can be accessed
individually or as a whole.
index
Definition: The address of an element in an
array.
Example: The index indicates the ordinal
296
number of the element, counting from the
beginning of the array.
node
Definition: In a data structure, an element
that contains both data and structural
elements used to process the data structure.
Example: The elements in a linked list are
traditionally called nodes.
305
one-dimensional array
Definition: An array with only one level of
indexing.
Example: The arrays discussed so far are
298
known as one-dimensional arrays because
the data is organized linearly in only one
direction.
record
Definition: Information related to one entity.
Example: A record is a collection of related
elements, possibly of different types, having
a single name.
302
two-dimensional array
Definition: An array with elements having
298
1
專業英文導讀
two levels of indexing.
Example: Figure 11.5 shows a table, which is
commonly called a two-dimensional array.
column-major storage
Definition: A method of storing
two-dimensional arrays in which the
elements are stored column by column.
Example: A computer may store the array
using column-major storage, in which the
entire column is stored before the next
column.
299
field
Definition: The smallest named unit of data
302
that has meaning in describing information.
Example: A field is the smallest element of
named data that has meaning.
link
Definition: In a list structure, the field that
identifies the next element in the list.
Example: A linked list is a collection of data in
which each element contains the location of
the next element--that is, each element
contains two parts: data and link.
305
multi-dimensional array
Definition: An array with elements having
more than one level of indexing.
Example: Multi-dimensional arrays--arrays
with more than two dimensions--are also
possible.
299
null pointer
Definition: A pointer that points to nothing.
Example: The link in the last element
contains a null pointer, indicating the end of
the list.
305
pointer
Definition: A constant or variable that
305
contains an address that can be used to
access data stored elsewhere.
Example: The link is used to chain the data
together, and contains a pointer (an address)
that identifies the next element in the list.
row-major storage
Definition: A method of storing array
elements in memory in which the elements
are stored row by row.
299
2
專業英文導讀
Example: Most computers use row-major
storage, in which an entire row of an array is
stored in memory before the next row.
linked list
Definition: A linear list structure in which the
ordering of the elements is determined by
link fields.
Example: A linked list is a collection of data in
which each element contains the location of
the next element-that is, each element
contains two part: data and link.
305
searching
Definition: The process that examines a list to
307
locate one or more elements containing a
designated value known as the search
argument.
Example: The searching algorithm for a linked
lists can only be sequential because the
nodes in a linked list have no specific names
that can be found using binary search.
Insertion
(insert operation)
Definition: An operation in a relational
database that inserts a tuple in a relation.
309
Example: Before insertion into a list, we first
apply the searching algorithm.
deletion
(delete operation)
Definition: In a relational database, the
operation that deletes a tuple from the
relation.
Example: Deletion is simpler than insertion:
we have only two cases—deleting the first
node and deleting any other node.
313
retrieval
Definition: The location and return of an
element in a list.
315
Example: Retrieving means randomly
accessing a node for the purpose of copying
the data contained in the node.
traversal
Definition: An algorithm process in which
each element in a structure is processed one
and only once.
Example: To traverse the list, we need a
“walking” pointer, which is a pointer that
315
3
專業英文導讀
moves from node to node as each element is
processed.







Summary
A data structure uses a collection of related variables that can be accessed
individually or as a whole. In other words, a data structure represents a set of
data items that share a specific relationship. We discussed three data structures in
this chapter arrays, records, and linked lists.
An array is a sequenced collection of elements normally of the same data type.
We use indexes to refer to the elements of an array. In an array we have two
types of identifiers: the name of the array and the name of each individual
element.
Many applications require that data is stored in more than one dimension. One
common example is a table, which is an array that consists of rows and columns.
Two-dimensional arrays can stored in memory using either row-major or
column-major storage. The first is more common.
The common operations on arrays as a structure are searching, insertion, deletion,
retrieval, and traversal. An array is a suitable structure in applications number of
deletions and insertions is small but a lot of searching and retrieval operations
are required. An array is normally a static data structure and so is more suitable
when the number of data items is fixed.
A record is a collection of related elements, possibly of different types, having a
single name. Each element in a record is called a field. A held is the smallest
element of named data that has meaning in a record.
A linked list is a collection of data in which each element contains the location of
the next element; that is, each element contains two parts: data and link. The data
part holds the useful information: the data to be processed. The link is used to
chain the data together.
The same operations defined for an array can be applied to a linked list. A linked
list is a very efficient structure for data that will go through many insertions and
deletions. A linked list is a dynamic data structure in which the list can start with
no nodes and grow as new nodes are needed.
4