L1 - CD 303 Concept of Data Structure
L1 - CD 303 Concept of Data Structure
The term "information" is sometimes used for data with given attributes, or,
in other words, meaningful or processed data. The way that data are organized
into the hierarchy of fields, records and files reflects the relationship between
attributes, entities and entity sets. That is, a field is a single elementary of
information representing an attribute of an entity, a record is the collection of
field values of a given entity and a file is the collection of records of the
entities in a given entity set.
Each record in a file may contain many field items, but the value in a certain
field may uniquely determine the record in the file. Such a field K is called a
primary key, and the values k1 k2, . . . in such a field are called keys or key
values.
The above organization of data into fields, records and files may not be
complex enough to maintain and efficiently process certain collections of
data. For this reason, data are also organized into more complex types of
structures. The study of such data structures, which forms the subject matter
of this text, includes the following three steps:
(1) it must be rich enough in structure to mirror the actual relationships of the
data it" the real world.
(2) On the other hand, the structure should be simple enough that one can
effectively process the data when necessary.
The data appearing in our data structures are processed by means of certain
operations. In fact, the particular data structure that one chooses for a given
situation depends largely on the frequency with which specific operations are
performed.
(1) Traversing: Accessing each record exactly once so that certain items in the
record may be processed. (This accessing and processing is sometimes called
"visiting" the record.)
(2) Searching: Finding the location of the record with a given key value, or
finding the locations of all records which satisfy one or more conditions.
(5) Sorting: Arranging the records in some logical order (e.g., alphabetically
according to some NAME key, or in numerical order according to some
NUMBER key, such as social security number or account number)
(6) Merging: Combining the records in two different sorted files into a single
sorted file.