0% found this document useful (0 votes)
32 views

Overview of Data Structure: Data Structures and Algorithms

This document provides an overview of data structures. It defines a data structure as the organization of data in memory or files to allow for efficient use. Common data structures include arrays, stacks, queues, linked lists, binary trees, hash tables, heaps, and graphs. Abstract data types specify a set of operations on a data type independently of implementation. Data structures can be organized at the abstract, application, and implementation levels. Linear data structures form a sequence while nonlinear do not. Examples of operations on data structures include traversal, search, insertion, deletion, sorting, and merging.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Overview of Data Structure: Data Structures and Algorithms

This document provides an overview of data structures. It defines a data structure as the organization of data in memory or files to allow for efficient use. Common data structures include arrays, stacks, queues, linked lists, binary trees, hash tables, heaps, and graphs. Abstract data types specify a set of operations on a data type independently of implementation. Data structures can be organized at the abstract, application, and implementation levels. Linear data structures form a sequence while nonlinear do not. Examples of operations on data structures include traversal, search, insertion, deletion, sorting, and merging.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

 Overview of Data Structure 

Data Structures and Algorithms


Introduction
•  A data structure is the organization of data in a computer's memory
or in a file. The proper choice of a data structure can lead to more
efficient programs.
• In computer science, a data structure is a way of storing data in a
computer so that it can be used efficiently. It is an organization of
mathematical and logical concepts of data. Often a carefully chosen
data structure will allow the most efficient algorithm to be used.
• Definition: A data structure is a representation of data and the
operations allowed on that data. 
Examples of Data Structure 
The following is a list of data structures used in application systems: 
• array
• stack
• queue
• linked list
• binary tree
• hash table
• heap
• graph
Abstract Data Types (ADT) 
• In computing, an abstract data type (ADT) is a specification of a set of
data and the set of operations that can be performed on the data.
• Such a data type is abstract in the sense that it is independent of
various concrete implementations.
• The ADT is the data type which has the following components:
• Operations: Specifications of external appearance of a data structure.
• Storage Structures: Organizations of data implemented in lower-leveldata
structures.
• Algorithms: Description on how to manipulate information in the storage
structures to obtain the results defined for the operations.
Levels of Data Structure 
Levels of Data Structure 
• The Abstract Level 
• The abstract (or logical) level is the specification of the data structure
- the "what" but not the "how".
• At this level, the user or data structure designer is free to think
outside the bounds of any programming language.
• For instance, a linear list type would consist of a collection of list
nodes such that they formed a sequence.
• The operations defined for this list might be insert, delete, sort and
retrieve. 
Levels of Data Structure 
• The Application Level
• At the application or user level, the user is modeling real-life data in a
specific context.
• In our list example we might specify what kinds of items were stored
in the list and how long the list is.
• The context will determine the definitions of the operations.
• For example, if the list was a list of character data, the operations
would have a different meaning than if we were talking about a
grocery list. 
Levels of Data Structure 
• The Implementation Level
• The implementation level is where the model becomes compiling and
generates executable code.
• We need to determine where the data will reside and allocate space
in that storage area.
• We also need to create the sequence of instructions that will cause
the operations to perform as specified. 
Types of Data Structure
• There are two types of data structures 
• Linear Data Structure
• A data structure is said to be linear if its elements form a sequence or a linear
list.  Examples of linear data structures include Array, Stack, Queue, Linked
list. 
• Nonlinear Data Structure
• A data structure is said to be nonlinear if its elements cannot form a sequence
or a linear list. Example of non linear data structures includes trees, graphs,
files etc. 
Arrays 
• Linear array (one dimensional array) is the simplest type of data structures.
• Linear array means a list of a finite number n of similar data type referenced
respectively by a set of n consecutive numbers 1, 2, 3… n.
• For example, if the name of the array is A then the elements of array A are
denoted either by subscript notation, or by the parenthesis notation, or by
the bracket notation. 
a1, a2, a3… an 
or 
A (1), A (2), A (3)… A (N) 
or 
A [1], A [2], A [3]… A [N] 
• Where the number N in A [N] is called a subscript and A [N] is called a
subscripted variable. 
Linked Lists 
• Linked list is a way to store data in memory.
• A linked list consists of a serious of nodes, which are not necessarily
adjacent in memory.
• Each node contains the data field which has the element and the next
field which has the link to the node containing its successor.
• Generally in linked list the elements are connected by the link field
which contains the address of the next node.
• The link field of last node is marked by null pointer which indicates the
end of the list and a START variable which contains the address of the
first node in the list.
Stack 
• It is a linear list in which insertions and deletions are restricted at one end, called
the top. The following figure shows a stack with 5 elements and the top pointer
where both insertion and deletion are performed. 

• Stack contains two operation push and pop. Push is used to insert an element
into stack and pop is used to remove an element from stack. The following figure
shows the two operations how it is performed in stack. It is also called as last- in
first- out (LIFO), because the element pushed last need to be popped out first. 
Queue 
• It is a linear list in which insertion and deletion will take place in
different end.
• As shown in figure below the end where we insert an element is
called the “rear” end and deletion at “front” end.
• The element entered first need to be removed first, so it is also called
as first- in first- out (FIFO). 
Trees 
• Tree is a nonlinear data structure which contains the hierarchical
relationship between various elements is called a tree.
• One node is distinguished as a root, every other node is connected by
a directed edge from exactly one other node, with the direction of
parent -> children. 
Graph 
• Data sometimes contain a relationship between pairs of elements
which is necessarily hierarchical in nature. The data structure referred
in figure below reflects this type of relationship is called a graph. 
Applications of Data Structure 
• Traversal: Travel through the data structure, travelling salesman problem,
shortest path problem. 
• Search: Traversal through the data structure for a given element,
appropriate searching methodology, searching a number from thousands
of random numbers. 
• Insertion: Adding new elements to the data structure, constructing index
tree, B-tree, insertion of elements into the sorted database. 
• Deletion: Removing an element from the data structure, garbage
collection, memory utilization and optimization. 
• Sorting: Arranging the elements in some order, appropriate sorting
method for appropriate architecture. 
• Merging: Combining two similar data structures into one 

You might also like