Sie sind auf Seite 1von 3

DATA STRUCTURES NOTES

Data Structures:
The logical or mathematical model of data is called a data
structure.
Data is actually plural of Datum, means Raw Information or unprocessed
information. Data are simply values or sets of values. A data item refers to a single
unit of values. For example, a students information may be divided into four
items/properties GRNO, name, class, and semester. But the GRNO would be
treated as unique/ item.
Data are also organized into more complex types of structures.
Types of Data Structures
There are two types of data structure are available
1. Linear
2. Non-Linear
1. Linear Structures: In this type of data structure we perform insert, delete,
search, update operations sequentially or in an order (like
Ascending/Descending). for example you have a list having 5 elements
containing A,B,C,D,E,F values if u want to find that on which location E is
store in this list, you must compare E with A,B,C,D and finally with E along
this you must perform an increment to counter. After that you will find the
actual location of your required/search item with the help of counter in this
example the value of counter=4.
Examples of Linear Data Structures are as follows:
Array
Linked List
Queue
Stack
1. Non-Linear: In this type of data structure we perform Traversing, insert,
delete, search, update operation randomly.
Examples of Non-Linear Data Structures are as follows:
Tree
Graph
Data Structure operations: 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. The following four operations play a major role
in this text.

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.
3. Inserting: adding a new record to the structure.
4. Deleing: Removing a record from the structure.
sometimes two or more of the operations may be used in a given situation; for
example we may want to delete the record with a given key, which may mean we
first need to search for the location of the record. the following two operations,
which are used in special situation, will also be considered.
1. Sorting: Arranging the records in some logical order (for example
alphabetically according to some Name key, or in numerical order according
to some Number key. such as account number.
2. Merging: Combining the records in two different sorted files into a single
sorted file
Algorithm: An algorithm, is a finite step-by-step list of well-defined instructions
for a particular problem.
Array: A linear array is a list of finite number n of homogeneous data
elements(i.e., data elements of the same type) such that:
a. The elements of the Array are referenced respectively by an index set
consisting of n consecutive numbers.
b. The elements of the Array are stored respectively in successive memory
locations
The number n of elements is called the length or size of the array. if not explicitly
stated , we will assume the index set consists of the integers 1,2,n. In general,
the length or the number of data elements of the array can obtained from the index
set by the formula
Length=UB-LB+1
where UB is the largest index, called the upper bound, and LB is the smallest
index, called the lower bound, of the array. Note that length=UB when LB=1.
The elements of an array A and may be denoted by the subscript notation
A1,A2,A3An
or by the parenthesis notation
chosen data structure will allow a more efficient algorithm to be used. The choice
of the data structure often begins from the c In In computer science, a data
structure is a way of storing data in a computer so that it can be used efficiently.
Often a carefully hoice of an abstract data structure. A well-designed data structure

allows a variety of critical operations to be performed on using as little resources,


both execution time and memory space, as possible.
Different kinds of data structures are suited to different kinds of applications, and
some are highly specialized to certain tasks. For example, B-trees are particularly
well-suited for implementation of databases, while routing tables rely on networks
of machines to function.
In the design of many types of programs, the choice of data structures is a primary
design consideration, as experience in building large systems has shown that the
difficulty of implementation and the quality and performance of the final result
depends heavily on choosing the best data structure. After the data structures are
chosen, the algorithms to be used often become relatively obvious. Sometimes
things work in the opposite direction - data structures are chosen because certain
key tasks have algorithms that work best with particular data structures. In either
case, the choice of appropriate data structures is crucial.
This insight has given rise to many formalised design methods and programming
languages in which data structures, rather than algorithms, are the key organising
factor. Most languages feature some sort of module system, allowing data
structures to be safely reused in different applications by hiding their verified
implementation details behind controlled interfaces. Object-oriented programming
languages such as C++ and Java in particular use objects for this purpose.
Since data structures are so crucial to professional programs, many of them enjoy
extensive support in standard libraries of modern programming languages and
environments, such as C++'s Standard Template Library, the Java API, and the
Microsoft .NET framework.
The fundamental building blocks of most data structures are arrays, records,
discriminated unions, and references. For example, the nullable reference, a
reference which can be null, is a combination of references and discriminated
unions, and the simplest linked data structure, the linked list, is built from records
and nullable references.
There is some debate about whether data structures represent implementations or
interfaces. How they are seen may be a matter of perspective. A data structure can
be viewed as an interface between two functions or as an implementation of
methods to access storage that is organized according to the associated data type.

Das könnte Ihnen auch gefallen