DATA STRUCTURE AND ALGORITHMS
DATA STRUCTURE AND ALGORITHMS
UNIT – I
2 MARK QUESTIONS
5 MARK QUESTIONS
10 MARK QUESTIONS
UNIT – II
2 MARK QUESTIONS
1. What is a stack?
2. What is a queue?
10. What is postfix expression evaluation and how is it performed using a stack?
13. List the advantages of using a circular queue over a linear queue.
16. Describe the circular queue and its application in computer science.
21. What is the difference between an array and linked representation of a queue?
5 MARK QUESTIONS
2. Describe the process of infix to postfix conversion. Include an example to illustrate the steps involved.
7. Discuss the various applications of stacks in real-world problems, such as function calls, undo
operations, and backtracking.
8. Compare and contrast a stack and a queue. Discuss their differences in terms of data access, operations,
and use cases.
10 MARK QUESTIONS
1. Explain the stack data structure. Describe its operations (push, pop, and peek) and discuss its
applications with examples.
2. Describe the process of converting an infix expression to postfix expression using a stack. Illustrate the
steps with an example.
3. What are the different operations that can be performed on a queue? Explain with examples.
4. Explain the concept of a circular queue. How does it improve upon the traditional queue? Discuss its
applications with an example.
5. What are the differences between a linear queue and a circular queue in terms of memory usage and
efficiency? Explain with examples.
6. Describe the linked list representation of a queue. How does it differ from the array-based
representation?
7. Explain postfix expression evaluation using a stack. Provide an example and show how the stack is used
to evaluate the expression.
8. What is the significance of stack operations in depth-first search (DFS) algorithms? Provide an example
to explain its role.
UNIT – III
2 MARK QUESTIONS
4. What is the difference between a Binary Search Tree (BST) and a Binary Tree?
7. Define a B-tree.
11. What is the significance of Inorder traversal in a binary search tree (BST)?
14. What are the advantages of using a Binary Search Tree (BST)?
5 MARK QUESTIONS
1. Explain the different types of binary tree traversals (Inorder, Preorder, and Postorder) with examples.
3. What is an AVL tree? Explain the balancing mechanism used in AVL trees.
4. Explain the concept and structure of a heap. What are the types of heaps (Max-Heap and Min-Heap),
5. Describe the structure of a B-tree and explain how it is used to store and manage large amounts of data
efficiently.
6. Discuss the different types of graph representations (adjacency matrix, adjacency list)
7. Explain the concept of a graph traversal algorithm. Compare and contrast Breadth-First Search (BFS)
and Depth-First Search (DFS) in terms of their methods, use cases, and performance.
8. What are the differences between a tree and a graph? Explain the various types of graphs (directed,
undirected, weighted, unweighted) and provide examples of their applications.
9. Discuss the process of constructing a binary search tree (BST) from a given set of elements.
10. What is a spanning tree in a graph? Explain how to find a spanning tree using Prim’s and Kruskal’s
algorithms. Provide examples to illustrate both algorithms.
10 MARK QUESTIONS
1. Explain the process of performing Inorder, Preorder, and Postorder traversals on a binary tree.
2. Describe the operations on Binary Search Trees (BST) with respect to insertion, deletion, and searching.
3. Explain the concept of an AVL tree and the types of rotations (left, right, left-right, right-left) used to
maintain balance during insertions and deletions. Provide examples of each rotation.
5. Explain how a B-tree is structured. Discuss its order and how it handles insertion, deletion, and search
operations.
6. Discuss the advantages and disadvantages of using an adjacency matrix and an adjacency list for graph
representation. Provide examples of when each representation is more efficient.
7. Describe the Breadth-First Search (BFS) and Depth-First Search (DFS) graph traversal algorithms.
Explain their differences, the types of problems they are suited for, and the data structures used to
implement them.
8. What is the difference between a tree and a general graph? Explain the various types of graphs (directed,
undirected, weighted, unweighted) and give examples of real-world applications for each type.
9. Explain the concept of a spanning tree in a graph. Describe how Prim’s and Kruskal’s algorithms are
used to find a minimum spanning tree (MST) and explain their differences.
10. What are the key properties of a binary tree, a binary search tree, and an AVL tree? Compare these types
of trees in terms of their structure, balance, and performance for different operations.
UNIT – IV
2 MARK QUESTIONS
1. What is an algorithm?
8. How does Depth-First Search (DFS) differ from BFS in graph traversal?
9. What is a minimum spanning tree (MST) in graph theory?
12. What is the Single Source Shortest Path (SSSP) problem in graph theory?
14. What is the difference between worst-case and best-case time complexity?
17. What is the difference between Breadth-First Search (BFS) and Depth-First Search (DFS) in terms of
their approach to traversing a graph?
18. Define the concept of a single source shortest path in graph theory.
21. How does Prim’s algorithm work in constructing a minimum spanning tree (MST)?
22. What is the difference between Prim’s and Kruskal’s algorithms for finding a minimum spanning tree?
24. What does "greedy algorithm" mean, and how is it applied in Kruskal's algorithm?
5 MARK QUESTIONS
1. Define an algorithm and explain its importance in problem-solving. Discuss the different types of
algorithms and their applications.
3. What are asymptotic notations? Discuss the differences between Big-O, Omega, and Theta notations
with examples.
5. Describe the Breadth-First Search (BFS) algorithm. How does BFS traverse a graph? Provide an
example to illustrate the steps involved.
6. Compare and contrast Breadth-First Search (BFS) and Depth-First Search (DFS) in terms of their
approach, applications, and performance.
7. What is the Single Source Shortest Path (SSSP) problem in graph theory?
10. Explain how Prim’s and Kruskal’s algorithms are used to find the MST and provide an example for each
algorithm.
11. Explain the process of solving the shortest path problem in a weighted graph using Dijkstra's algorithm.
Include a step-by-step example to demonstrate its operation.
12. Describe Prim’s and Kruskal’s algorithms for finding a Minimum Spanning Tree (MST). Compare their
approaches and explain the advantages and disadvantages of each algorithm.
10 MARK QUESTIONS
1. Explain the process of analyzing an algorithm’s time complexity using asymptotic notations. Discuss
how Big-O notation is used to describe the upper bound of an algorithm’s performance.
2. What is a greedy algorithm? Discuss its role in solving problems like Minimum Spanning Trees (MST)
and the Single Source Shortest Path (SSSP). Provide examples of how greedy algorithms are used in
Prim’s and Kruskal’s algorithms.
3. What is the importance of pseudocode in algorithm design? Write an algorithm in pseudocode to find
the factorial of a given number and explain each step.
4. Discuss the differences between Depth-First Search (DFS) and Breadth-First Search (BFS) in terms of
their traversal strategies, time complexity, and typical use cases.
5. Explain the steps involved in converting an undirected graph into a spanning tree using Kruskal’s
algorithm. Provide a detailed example to show how the algorithm works with a graph.
6. What is the Single Source Shortest Path problem? Discuss how the Bellman-Ford algorithm is used to
find the shortest paths from a single source to all other vertices in a weighted graph.
7. Describe the process of finding the Minimum Spanning Tree (MST) using Prim’s algorithm. Provide a
detailed example to explain how the algorithm works.
8. Explain the differences between an adjacency list and an adjacency matrix representation of a graph.
Discuss the advantages and disadvantages of each with respect to memory usage and performance.
9. What is a topological sort in graph theory? Explain the algorithm for topological sorting and provide an
example of how it can be applied to a directed acyclic graph (DAG).
10. Discuss the concept of practical complexities in algorithm analysis. How does practical complexity
differ from theoretical time complexity, and why is it important in real-world applications?
UNIT – V
2 MARK QUESTIONS
5 MARK QUESTIONS
1. Explain the divide and conquer approach in algorithm design. How is it applied in algorithms like
Binary Search, Quick Sort, and Merge Sort?
2. Describe the process of performing a Binary Search. How does this algorithm work in a sorted array,
and what is its time complexity in the best, worst, and average cases?
3. Explain the Quick Sort algorithm. Describe its working with the help of an example. What is Merge
Sort? Describe how the algorithm divides the input array and merges the sorted subarrays.
4. What is the time complexity of Merge Sort, and why is it preferred over Quick Sort in some cases?
5. Compare and contrast Quick Sort and Merge Sort. Discuss their advantages, disadvantages, and time
complexities. Which algorithm is preferred in different scenarios and why?
6. Explain the general method used in backtracking. How does backtracking work to find solutions for
problems like the 8 Queens problem? Provide a step-by-step explanation.
7. Describe the 8 Queens problem and explain how backtracking is used to solve it.
8. What is Graph Coloring in backtracking? Explain how backtracking is used to color a graph such that no
two adjacent vertices have the same color. Provide an example to illustrate the process.
10 MARK QUESTIONS
2. What is the recurrence relation for the time complexity of the Merge Sort algorithm? Derive its time
complexity using the Master Theorem.
5. Discuss the divide and conquer method with an example of how it is used to solve the problem of matrix
multiplication (Strassen's algorithm).
6. What is backtracking, and how is it used to solve the N-Queens problem? Describe the step-by-step
process of placing queens on the board while ensuring no two queens threaten each other.
8. Discuss how the backtracking algorithm can be used to solve the Hamiltonian Cycle problem
9. What is the Graph Coloring problem, and how is backtracking applied to find a valid coloring for a
graph? Provide an example to demonstrate the process of coloring a graph using backtracking.
Mrs. Krishnaveni. N