Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

IMPORTANCE OF

DATA STRUCTURES
AND
ALGORITHMS
WELCOME TO THE WORLD OF
Data Structures And Algorithms
Algorithm
 Ever made a plan to hangout at an
amusement park?

 Did you ever spend time making a schedule


for your destinations for a date?

 Ever been to a shopping mall?


Cont..
 Or even simple , ever made a sandwich?
Cont..
 In the above examples , you will find one
thing common
 Set of process/rules/steps/instructions
 This is algorithm
Data Structures
 organization for a collection of data items.
 A data structure requires a certain amount

of:
1. space for each data item it stores
2. time to perform a single basic operation
3. programming effort.
 Graphs , trees , stacks , queues these are

Data Structures
Stack
 Stack is organized as a Last In First Out(LIFO)
data structure.
 Linear Data Structure
 Imagine a Pile of Plates
 Pile is a Stack
 Plate as variable
 Pile as Data Structure
Cont..
 Operations performed on Stacks are:
1. Insert an item into the stack (Store)
2. Delete an item from the stack (Retrieve)
3. Display the contents of the stack
Cont..
 Conversion of expressions.
Infix to postfix, postfix to prefix, prefix to infix, vice
versa.
 Evaluation of expressions.

Arithmetic expression in the form of either postfix or


prefix
 Recursion.

Ex. Tower of Hanoi etc.


 Other applications.

Ex:Checking if a string is a palindrome or not.


Topological Sort.
 System Software and Compiler Design
Queue
 Queue is organized as First In First Out
(FIFO)Data Structure.
 Linear Data Structure
 Consider real life example
Cont..
 Insert an item into a queue
 Delete an item from queue
 Display

 Technically,
 In many Job Scheduling Algorithm,
 Round robin scheduling etc.
Trees
 Nature view of a tree
Computer Scientist’s View
What is a Tree
 It is an abstract model of a hierarchical
structure
 Consists of nodes with a parent child relation
Graph
 A data structure that consists of a set of nodes
(vertices) and a set of edges that relate the nodes
to each other
 The set of edges describes relationships among the
vertices
Cont..
 Facebook is an example of undirected graph
Cont..
 Google maps uses graphs for building transportation
systems
 Shortest path finding algorithm in maps
Sorting
 Arranging a set of data in some logical order
Sorting Techniques
 Arranging objects in certain way
-Easy to access(accessibility)
-will the shelf last(hardware’s ability)
-No. of books
 The above points are constraints
 Ex: Bubble sort , quick sort ,
insertion sort , merge sort
etc.
Searching
 Technique that helps in finding the place of a
given element
 Searching a book from beginning to last in a

single shelf
 … Congrats!!!
 You used Linear search
Cont..
 What if there are many more books ??
 And multiple shelf …???
Cont..
 Start searching from a part of shelf
 Again sort it and search for book
 Congrats...!!!
 You used Binary Search
Conclusion
 Some of many daily activities knowing or
unknowingly do with the help of Data
Structures and Algorithms
 Thus ,this world is surrounded by Data

Structures and Algorithms


Any Queries??
THANK YOU

You might also like