1. WHY ON EARTH YOU SHOULD KNOW DATA
STRUCTURES
NISHANT KUMAR BEHL
2. CONTENT
WHY WHY WHY SHOULD u KNOW Data Structure
Smartest Engineers like you definitely knows
Arrays
Stacks
Queues
Linked lists
Trees
Hash Tables
Graphs
3. WHY WHY WHY… SHOULD U KNOW DATA STRUCTURE
Smartest Engineers are the ones who understand how things work internally
Smartest Engineers are the ones who gets advantages and disadvantages of various things
Smartest Engineers build code that is readable and scalable
Smartest Engineers build code that is fastest and yet accurate
Smartest Engineers knows Data Structure IN & Out
ARE YOU THE SMARTEST ENGINNER ???
4. ARRAYS
FeaturesProperties
Collection of Items, more or less of similar type together
Items are stored in continuous memory location
Each Item has an index associated with it
Each Item has an memory location associated to it
Operations
Lookup , Delete, Insert and Push
Real-life Application
A E U F N
151
0
152
1
153
2
154
3
155
4
Memory
Indices
5. STACKS
FeaturesProperties
Items are put up one after another
Last Item to go Inside will be the First one to come outside – LIFO
Operations
Lookup , Peek, pop and Push
Real-life Application
Back and forward buttonoperations are good example of using Stacks
6. QUEUES
FeaturesProperties
Frist one to get inside will be the first one to go out
FIFO
Operations
Peek, lookup, enqueue dequeue
Real-life Application
Prioritization while allocating cab to a requestor within small radius, Person to request first will get cab first
7. LINKED LIST
FeaturesProperties
Each item hashave pointers to another items
Uses less memory than array
Faster lookup, insert & delete operations than array
Each list has head and tail, tail points to nothing
Operations
Insert , lookup, delete, append, prepend
Real-life Application
Versatile, e.g; replaces use of arrays for faster execution
8. TREES
FeaturesProperties
Hierarchical structure – Root, Parent,Child ,leaf, sibling
Non-Linear traversal paths due to hierarchy
Real-life Application
DOM-Document object model implements tree data structure i.e; fb html web page, fb comments
Chess game
Zomato as example can use tree data structure to narrow down resteraunt search on the map
9. HASH TABLESHASH MAPS
FeaturesProperties
Key-Value pair storage mapped to a memory address
Extremely Fast in operations
Md5,SHA-1,SHA-256 can be used to Hash a value
Extremely useful in scalability system design principal
Consistent Hashing is one of highest used methodology
Real-life Application
Large scale distributed application, KeyGenerator app, database shards, session maps, caches
10. GRAPHS
FeaturesProperties
Network of Nodes and Edges
Great in modelling real world relationships
Graph in a way encompass Trees and linked lists
Real-life Application
Good to represent relationships, family tree, network, friendships…like in fb family groups, roads in maps
Facebook uses to create social network & recommendation engines (friends suggestions)
Google uses it to find the optimumshortest path to reach your request
11. WHAT DOES THIS DECK GIVE YOU
Well, you can use it as Cheat sheet
You can use it to brush up :
Features
Operations
Real-life applications