List of Experiments ADSA For Lab Exam
List of Experiments ADSA For Lab Exam
LAB EXAM
1 L Find the Maximum and Minimum Elements in an Array: Write a function to find the maximum
and minimum elements in an array.
2 L Reverse an Array: Write a function to reverse an array in place.
3 L Find the Kth Smallest/Largest Element in an Array: Write a function to find the Kth
smallest or largest element in an array.
4 L Sort an Array of 0s, 1s, and 2s: Given an array containing only 0s, 1s, and 2s, sort the array in
linear time.
5 L Move All Zeroes to End of Array: Write a function to move all zeroes in an array to the end while
maintaining the relative order of other elements.
6 L Reverse a Linked List: Write a function to reverse a singly linked list.
7 L Detect a Cycle in a Linked List: Write a function to detect if a cycle exists in a linked list.
8 L Find the Middle of a Linked List: Write a function to find the middle element of a linked list.
9 L Merge Two Sorted Linked Lists: Write a function to merge two sorted linked lists into one
sorted linked list.
10 L Remove Nth Node from End of List: Write a function to remove the Nth node from the start/end
of a linked list.
11 L Implement a Stack Using Arrays/Lists: Write a function to implement a stack using an array or
list with basic operations: push, pop, peek, and isEmpty.
12 L Implement a Stack Using Linked List: Write a function to implement a stack using alinked list
with basic operations: push, pop, peek, and isEmpty.
13 L Check for Balanced Parentheses: Write a function to check if a string containing parentheses is
balanced.
14 L Evaluate Postfix Expression: Write a function to evaluate a given postfix expression.
15 L Next Greater Element: Write a function to find the next greater element for each elementin an
array.
16 L Implement a Queue Using Arrays/Lists: Write a function to implement a queue using an array or
list with basic operations: enqueue, dequeue, front, and isEmpty.
17 L Implement a Queue Using Linked List: Write a function to implement a queue using a linked list
with basic operations: enqueue, dequeue, front, and isEmpty.
18 L Implement a Circular Queue: Write a function to implement a circular queue with basic
operations: enqueue, dequeue, front, rear, and isEmpty.
19 L Generate Binary Numbers from 1 to N: Write a function to generate binary numbers from1 to N
using a queue.
20 L Implement a Queue Using Stacks: Write a function to implement a queue using two stacks. (vice-
versa)
21 L Implement a Binary Tree: Write a class to implement a basic binary tree with insert,delete, and
traversal operations.
22 L Inorder Traversal: Write a function to perform inorder traversal of a binary tree.
25 L Level Order Traversal: Write a function to perform level order traversal of a binary tree.
26 L Height of a Binary Tree: Write a function to find the height of a binary tree.
27 L Diameter of a Binary Tree: Write a function to find the diameter of a binary tree.
28 L Check if a Binary Tree is Balanced: Write a function to check if a binary tree is height balanced.
29 L Lowest Common Ancestor: Write a function to find the lowest common ancestor of two nodes in
a binary tree.
30 L Implement Graph Using Adjacency List: Write a class to implement a basic graph usingan
adjacency list with methods to add vertices and edges.
31 L Breadth-First Search (BFS): Write a function to perform BFS on a graph from a givenstart vertex.
32 L Depth-First Search (DFS): Write a function to perform DFS on a graph from a given start vertex.