Data Structures and
Algorithms
Introduction
Dr. R. Jothi, SCOPE
VIT Chennai
Outline
Data Structure Introduction
Examples
Course Outcomes
Syllabus
Dr. R. Jothi, VIT Chennai
Data
All programs manipulate data
programs process, store, display, gather
data can be numbers, strings, images, sound
Each program must decide how to store data
Choice influences program at every level
execution speed
memory requirements
maintenance (debugging, extending, etc.)
How do you arrange your bookshelf?
Subject-wise
Size
Most frequently read (priority)
Currently reading books in top/front row
Volume-wise
Volume-1, Volume-2, Volume-3……..
What is data structure?
A method to organize data in computers memory
Facilitates effective storage and retrieval of data
Dr. R. Jothi, VIT Chennai
Data structure examples
How does Google find the documents matching your
query so fast?
Uses sophisticated algorithms (crawling, etc.) to create
index structures, which are just data structures.
How to organize data in mobile
phones?
Dr. R. Jothi, VIT Chennai
How do you design ContactList?
Can we use array?
Dr. R. Jothi, VIT Chennai
Array – Contiguous Memory
Fixed size
Too large – wastage of memory
Too small - overflow
Dr. R. Jothi, VIT Chennai
Arrays of structures
Example:
struct contact{
#name, phoneno, email..
}cc[100];
John
12345 M
COMP
...
0 1 2 … 98 99 11
Faster access
Prefix based search
Dr. R. Jothi, VIT Chennai
Trie Data Structure
Dr. R. Jothi, VIT Chennai
ScreenLock
Matrix of pixels
Connectivity - graph
Dr. R. Jothi, VIT Chennai
GoogleMap
A geographical map
A set of Vertices with edges
connecting them
Vertices - Locations
Edges- path from one
location to another
Shortest path
Dr. R. Jothi, VIT Chennai
Social Networks as Graph
Which data structure
used to store recent tab
in phone?
Stack - LIFO
Dr. R. Jothi, VIT Chennai
Queue
Relationship: First in first Out
Tree
Hierarchical Relationship
Algorithm
Plan for solving a problem
step-by-step procedure
Many algorithms may be written for the same problem
Analyze and pick the efficient one
Time
Memory
Dr. R. Jothi, VIT Chennai
An Algorithm Development Process
Step 1: Obtain a description of the problem.
Step 2: Develop a high-level algorithm.
Step 3: Analyze the algorithm.
Step 4: Refine the algorithm, if needed
Step 5: Implement the algorithm and verify
Dr. R. Jothi, VIT Chennai
Why this course?
Efficient problem-solving using computers, irrespective of the
discipline or application, calls for the design of efficient algorithms
Inclusion of appropriate data structures is of critical importance to
the design of efficient algorithms
In other words, good algorithm design must go hand in hand with
appropriate data structures for efficient program design to solve a
problem
Program = Algorithm + Data Structure
Course Outcomes
1. Analyze the worst-case running time of algorithms
2. Explain the major data structures and their analyses.
3. Explain major algorithm design paradigms and their analyses.
4. Explain the major graph algorithms and their analyses.
5. Compare between different data structures and algorithmic
techniques for a given problem and assess the tradeoffs involved.
6. Synthesize efficient data structures and algorithms and provide
program solutions in engineering design situations.
7. Provide algorithmic solutions to real-world problems
Dr. R. Jothi, VIT Chennai
Almost every interview
Companies like (70% of tech qns come from Data
strcuture)
Amazon,
FlipKart
Mocrosoft,
Google,
Facebook
Apple
IBM
CTS
Infosys
Prerequisites
Nothing!!!
But,
good programming skill
Logical reasoning
What I expect from You
Interaction in the class
Implement, Implement, Implement
Until you code, you don’t get the real feeling of DS
Get acquainted with C language (Structures, Pointers)
Take Assignments seriously
Be genuine - No copy paste
Only one deadline – decided by you
If not done, personally meet (mail) me
Continuous evaluation
Don’t study just before exam