PPT will clarify the basic concepts regarding Data Structure and will answer the basic questions like:
What is the requirement of structing the data in the memory?
What are the different ways one can arrange the data for better time complexity and space complexity.
4. NJL
NJL
NJL First Year Books
Second Year Books
Third Year Books
Example 1
First
Year
Book
Second
Year
Book
Third
Year
Book
If you arrange the books in some order, then to pick any particular book of first year,
you just need to check the books on the top of the rack. This will save time.
5. NJL
NJL
NJL
Example 1
If book 2 present in first year
books, is also required in
second year, then we can put
a chit in slab2 that gives
indication to find the required
book in first year books slab.
This helps in avoiding
duplication of the books.
First Year Books
Second Year Books
Third Year Books
Refer book 2 in
First year
Books
6. NJL
NJL
NJL
Flat1
Example 2
Flat2 Flat3 Flat4 Flat5 Flat6 Flat7 Flat8 Flat9
If the delivery boy has to deliver some items to flat number 3, 1, 7, 4, and 8,
then the delivery boy usually arranges the parcels to be delivered in
sequence in which flats are present..
7. NJL
NJL
NJL
Flat1
Example 2
Flat2 Flat3 Flat4 Flat5 Flat6 Flat7 Flat8 Flat9
That is delivery boy will delivery the parcel in the following order: 1, 3, 4, 7
and 8.
9. NJL
NJL
NJL
● By arranging the items or parcel in order we reduces time in accessing the
items:
1.It will take less time to search any particular book or parcel.
2.It will take minimum time to insert a new book or parcel at proper
location.
3.If we want to remove any item, again it will take less time.
● It helps in using the space available in an efficient way such that duplication
of the data can be avoided
Advantage of structuring the items
10. NJL
NJL
NJL
● In the computer data is stored in the memory.
● To avoid the duplication of data and to access or manipulate
the data in minimum time, our data in the memory should be
structures in some particular order.
● Way to arrange the data in the memory in some particular
order so that data can be used efficiently in terms of space and
time complexity is known as Data Structure.
● It is a logical and mathematical model of organizing a data in
the computer memory.
Data structure 0000
0001
0010
0011
0100
0101
0110
0111
:
1101
1110
1111
Computer
Memory
11. NJL
NJL
NJL ● Arrays
● Linked List
● Stacks
● Queues
● Trees
● Graphs
Types of Data Structure
12. NJL
NJL
NJL
Array is a collection of homogeneous data elements that is all the data should be
of same data types.
Arrays can be 1D array, 2D array or multi dimensional array.
Data Structure: Arrays
arr = 2 4 1 6 7 8
Array index arr[0] arr[1] arr[2] arr[3] arr[4] arr[5] arr[6]
Memory
Address
200 204 208 212 216 220 224
13. NJL
NJL
NJL
Data Structure: Linked List
● It is a collection of nodes with each node carry the information of the data
and the pointer that stores the address of the next data in sequence.
● Address of the first data is available in the head pointer.
● X mentioned in the last node indicates the end of the linked list.
A 210
250
B 200
210
C X
200
Head 250
14. NJL
NJL
NJL
Data Structure: Stacks
1
5
8
6
2
Top ⇒
Bottom ⇒
● It is a data structure in which data can be inserted or removed
or read only from the top.
● Other data is inaccessible unless the top data is removed.
● One of the application of Stack data structure is in backtracking
in which we need to go back to previous state. EG Back and
forward buttons available in web browsers.
● Another application is in function call.
● Stack can be implemented using an array or linked list.
15. NJL
NJL
NJL
Data Structure: Queues
9 1 5 8 6 2
Front
Rear
● It is a data structure in which data can be inserted only at the rear side,
whereas data can be removed or read only from the front side.
● One of the major application of Queue data structure is in serving requests
on a single shared resource, like a printer, CPU task scheduling etc.
● Queue can be implemented using an array or linked list.
16. NJL
NJL
NJL
Data Structure: Trees
● It is a data structure in which data is arranged in an hierarchy order.
● First node is known as root node.
● There is a unique path from the root to each node.
50
30 60
10 35 80
75 82
17. NJL
NJL
NJL
Data Structure: Graph
B
A
C
D
F
E
2
5
2
2
2
2
2
1
If a number on the line represents the price
one have to spend for travelling from one
node to another node, then determine the
path that one should follow for travelling
from node A to node D spending minimum
price.
18. NJL
NJL
NJL
Data Structure: Common Operations
● Traversal:-Accessing each element exactly once in order to process it.
● Searching:-Finding the location of a given element.
● Insertion:-Adding the new element to the structure.
● Deletion:-Removing a existing element from the structure.
● Sorting:-Arranging the elements in logical order.
● Merging:-Combining the elements of two similar sorted structures into a
single structure.
19. NJL
NJL
NJL
Data Structure: Common Operations
Data structures are classified into two types:
● Linear data structures: Elements are accessed in a sequential order but it
is not compulsory to store all elements sequentially.
Examples: Arrays, Linked Lists, Stacks and Queues.
● Non – linear data structures: Elements of this data structure are
stored/accessed in a non-linear order.
Examples: Trees and graphs.
20. NJL
NJL
NJL
Abstract Data Structure
To simplify the process of solving problems, data structures is combined with
their operations. This combination is known as Abstract Data Types (ADTs).
An ADT consists of two parts:
1. Declaration of data
2. Declaration of operations
Some example of ADT are Stacks and Queues.
21. NJL
NJL
NJL
Any Questions?
You can put your query in the comments section
Connect with me at
Website: www.nishantjainlab.in
YouTube Channel: nishantjainlab
Linkedin: www.linkedin.com/in/nishantjain86
Facebook page: BioMedical Signal and Image Processing @Biomedical2018
Email Id: nishantjain86@gmail.com