Download as pdf or txt
Download as pdf or txt
You are on page 1of 35

TOPIC

Introduction To

Data Structure
What is DATA STRUCTURE? Any Idea…
Data Structure
A study of various ways of storing and organizing
data in a computer.
Data Structure is designed

to organize data to suit a specific purpose.


Data Structure makes the use of data efficiently.
Why DATA STRUCTURE
is important?
Any idea…
Without data structure we cannot convert data
into information.

In Computer, w/o data structure, there will be no


Information.
Take for example

Computer uses 0’s & 1’s.

It's only from the structure of this binary


numbers can we determine the information
contained by the computer.

Without data structure understanding


computer will not be possible.
What are the Uses of Data
Structure? Any idea…
Used by
Operating Systems
Used by
Compilers
Used by
Database Management Systems
Used by
Data Communications
Used by
Search Engine
Examples of Data Structures

Basic Data Structures

Linear Data Structures Non-Linear Data Structures

Arrays Stacks Queues Trees Graphs Hash Tables

Linked Lists
array

linked list

queue
tree stack
Types of Data Structure
Linear : values are arrange in linear fashion.

– Array
– Linked-list
– Stack
– Queue
Types of Data Structure
Non-Linear : The data values in this structure are not
arranged in order.

– Tree : Data is organized in branches.

– Graph : A more general branching structure, with


less strict connection conditions than for a tree
Types of Data Structure
Homogenous : values of the same types of data are
stored.
– Array

Non-Homogenous : values of different types are grouped


and stored.
– Structures
– Classes
No single data structure works well for
all purposes, and so it is important to know
the strengths and limitations of several of
them.
Stacks
• Data collection with access only to the last
element inserted
Data4 Top
• Last in first out (LIFO)
Data3

Data2

Data1
Stacks Operation
Insert – Adding Data Item

Remove – Deleting Data Item

Top – Getting Top Data Item

Make empty – Removing all the Data Item


Stacks Operation
Stack Example

Container

Elements
Queues
• Collection with access only to the item that
has been present the longest

• First in First out (FIFO)

Front Back

Data1 Data2 Data3 Data4


Queues Operation
• Insert

• Remove

• Front
Queues Operations
Queues Example
List
• A Flexible structure, because can grow and
expand on demand.

last
first
List Operations
Elements can be:

 Inserted

 Deleted

 Accessed

At any position
List Example
Tree
• A Tree is a collection of elements called nodes.

• One of the node is distinguished as a root, along


with a relation (“parenthood”) that places a
hierarchical structure on the nodes.
Root
Tree Example
END of the SLIDE

You might also like