3. OBJECTIVES
To be familiar with the use of data structure as the
foundational base for computer solutions to problem
To understand basic concepts about arrat, stack, queue, list,
trees and graphs.
To understand various techniques of searching and sorting.
4. WHAT IS DATA STRUCTURE
Data structure is a particular way of storing and organizing data in a
computer, so that it can be efficiently used.
They provide a means to manage large amounts of data efficiently,
such as large databases.
Data are simply values or set of values and Database is organized
collection of data.
6. Operation Description
Insertion Add a new element to the data structure.
Deletion Remove an existing element from the data structure.
Traversal Visit all elements in the data structure
Searching Find the location of a specific element.
Sorting Arrange elements in a specific order.
Updating Modify the value of an existing element.
Accessing Retrieve a specific element using its position or key.
Merging Combine two data structures of the same type into one.
Splitting Divide one data structure into two or more parts.
7. ARRAY
• Array is a linear data structure where all
elements are arranged sequentially.
• It is a collection of elements of same
datatype stored at contiguous
memory locations.
9. Application of arrays
• Data storage - Store fixed size homogenous data
• Algorithms - Sorting, Searching.
• OS/Buffers - Circular input/output buffers
• Graph & trees - Adjacency Matrix/ list,heap.
• Programming Languages - String storage and manipulation.
• Web/Multimedia - Images, Video(pixel/frame arrays)
10. Linked list
• A linked list is a linear data structure consisting of
nodes, where each node contains data and a
reference to the next node.
Linked List Structure
A linked list is made up of nodes, where each node
contains:
• Data: The value stored in the node.
• Next: A pointer/reference to the next node in the
list.
11. Types of Linked List
• Singly Linked List – Each node has only one reference to the next node in the sequence.
• Doubly Linked List – Each node contains two references: one pointing to the next node and one pointing
to the previous node.
• Circular Linked List – The last node in the list points back to the first node, forming a circular structure.
13. STACK
A stack is a last in first out (LIFO) data structure. It
supports two basic operations called push and pop.
The push operation adds an element at the top of the
stack and the pop operation removes an element from
the top of the stack.
15. Applications of stack
Browsers use stack data structure to keep track of
previously visited sites.
Call log in mobile also uses stack data structure.
The stack is used in media players. Useful to playing
next and previous song.
16. QUEUE
• A queue is a linear data structure that follows the FIFO (First-In, First-
Out) principle. This means that the first element added to the queue
will be the first one to be removed.
18. TREE
A tree data structure organizes
elements in a hierarchy, like a family
tree. It has
• Root: The topmost element.
• Parent & Child: A node that has
smaller nodes (children) below it.
• Leaf: A node with no children.
19. Types of Trees :
• Binary Tree : Each node can have at most two children.
• Binary Search Tree (BST): A binary tree with the property that left children are
smaller than the parent, and right children are larger.
• Balanced Tree: A tree where the height is minimized (e.g., AVL tree, Red-Black
tree).
• Heap: A tree where the parent has a priority over children (Min Heap, Max
Heap).
20. Graph
• A graph is a collection of vertices (nodes)
and edges (connections). It can be
represented as G = (V, E), where:
• V is the set of vertices.
• E is the set of edges.
22. Applications of Graph
• Modeling networks, web pages, and social media connections
• Analyzing social networks and connections between individuals and
groups
• Representing transportation systems (e.g., Google Maps)
• Supporting computer vision and natural language processing
• Designing circuits
• Bioinformatics