Introduction To Data Structure
Introduction To Data Structure
A program is said to be efficient when it executes in minimum time and with minimum memory space.
It runs correctly
It is easy to modify.
DATA STRUCTURE
Definition
A data structure is a particular way of storing and organizing data either in computer’s memory or on the disk
storage so that it can be used efficiently. Data structures are used in almost every program or software system.
Common examples of data structures are arrays, linked lists, queues, stacks, binary trees, and hash tables etc.
Compiler design
Operating system
DBMS
Numerical analysis
Simulation
Artificial Intelligence
The major data structures used in the Network data model is graphs, Hierarchical data model is trees, and RDBMS is
arrays. Specific data structures are essential ingredients of many efficient algorithms as they enable the
1.Analysis of the problem to determine the basic operations that must be supported. For example, basic operation
The first concern is data and the operations that are to be performed on them.
Data structures are building blocks of a program. The term data means a value or set of values. It specifies either the
value of a variable or a constant. A record is a collection of data items. A file is a collection of related records. Each
record in a file may consist of multiple data items but the value of a certain data item uniquely identifies the record
in the file. Such a data item K is called a primary key, and the values K1, K2 ... in such field are called keys or key
values.
Data structures are generally categorized into two classes: primitive and non-primitive data structures.
Primitive data structures are the fundamental data types which are supported by a programming language.
Some basic data types are integer, real, character, and boolean.
Non-primitive data structures are those data structures which are created using primitive data structures.
Examples of such data structures include linked lists, stacks, trees, and graphs. Non-primitive data structures
can further be classified into two categories: linear and non- linear data structures.
If the elements of a data structure are stored in a linear or sequential order, then it is a linear data structure.
Examples include arrays, linked lists, stacks, and queues. Linear data structures can be represented in memory in two
different ways. One way is to have to a linear relationship between elements by means of sequential memory
locations. The other way is to have a linear relationship between elements by means of links.
If the elements of a data structure are not stored in a sequential order, then it is a non-linear data structure. The
relationship of adjacency is not maintained between elements of a non-linear data structure. Examples include trees
and graphs.
OPERATIONS ON DATA STRUCTURES
Sorting: Rearranging the elements in some type of order (e.g Increasing or Decreasing).
An abstract data type (ADT) is the way we look at a data structure, focusing on what it does and ignoring
how it does its job. The abstract data type is a triple of D-set of Domains, F-Set of functions, A-Axioms in which only
Examples:
Stacks
Queues
Linked List
ADT Operations
While modeling the problems the necessary details are separated out from the unnecessary details. This
The model defines an abstract view to the problem. It focuses only on problem related stuff and that you try
Modification: any desired element can be deleted from the data structure.
It is reusable, robust
The Working of various integrated operation cannot be tampered with by the application program