Unit I – Introduction to Data Structures & Algorithms
2 Marks Questions – with concise answers
1. Define Data Structure.
Ans: A data structure is a way of organizing and storing data so it can be accessed and modified efficiently.
2. What is an Abstract Data Type (ADT)?
Ans: An ADT is a theoretical model for a data structure that defines its behavior (operations) without specifying its
implementation.
3. Define Space Complexity.
Ans: Space complexity is the amount of memory required by an algorithm to run to completion.
4. What is Time Complexity?
Ans: Time complexity is the amount of time an algorithm takes to complete as a function of input size.
5. Write the Big O notation for Binary Search.
Ans: O(log n).
6. What is Divide and Conquer? Give one example.
Ans: It is a problem-solving method that divides a problem into smaller subproblems, solves them, and combines
results. Example: Merge Sort.
7. Name any two Asymptotic Notations.
Ans: Big O, Big Omega (Ω).
8. What is Backtracking?
Ans: Backtracking is a method of solving problems by trying possible solutions and abandoning those that fail to satisfy
constraints.
9. State the time complexity of Heap Sort.
Ans: O(n log n).
10. Which sorting technique uses the concept of merging?
Ans: Merge Sort.
10 Marks Questions – with detailed answers
1. Explain different types of data structures with examples.
Ans: Linear, Non-linear, Homogeneous, Heterogeneous, Static, Dynamic with examples.
2. Describe Abstract Data Types (ADT) and give two examples.
Ans: Defines data and operations without implementation; examples: Stack ADT, Queue ADT.
3. Explain Space Complexity and its components.
Ans: Fixed part and variable part explained.
4. Explain Time Complexity and give an example calculation.
Ans: Execution time as input size changes; example: linear search O(n).
5. Discuss Asymptotic Notations with examples.
Ans: Big O, Big Omega, Theta with binary search example.
6. Explain Divide and Conquer method with Merge Sort algorithm.
Ans: Divide, sort halves, merge; O(n log n).
7. Write and explain the algorithm for Heap Sort.
Ans: Build max heap, swap root, heapify.
8. Explain Backtracking with an example problem.
Ans: N-Queens example.
9. Differentiate between Merge Sort and Heap Sort.
Ans: Stability, space, method differences.
10. Write algorithms for Bubble, Selection, Insertion Sort and compare complexities.
Ans: All O(n²) except best-case insertion O(n).
Unit II – Hashing, Arrays & Lists
2 Marks Questions – with concise answers
1. What is hashing?
Ans: Technique to map data to a fixed-size value for fast retrieval.
2. Name two common hashing functions.
Ans: Division method, Multiplication method.
3. What is a collision in hashing?
Ans: When two different keys produce the same hash value.
4. Give two collision resolution techniques.
Ans: Linear probing, Quadratic probing.
5. What is rehashing?
Ans: Resizing the hash table and recalculating hash values.
6. What is an array?
Ans: Collection of elements of same data type in contiguous memory.
7. Write one advantage of linked lists over arrays.
Ans: Dynamic memory allocation.
8. Name two types of linked lists.
Ans: Singly linked list, Doubly linked list.
9. What is a circular linked list?
Ans: Last node points to the first node.
10. Define Radix Sort.
Ans: Sorts by processing digits from least to most significant.
10 Marks Questions – with detailed answers
1. Explain hashing and its advantages.
Ans: O(1) search, fast insertion/deletion.
2. Discuss different hashing functions with examples.
Ans: Division, multiplication, folding methods.
3. Explain collision resolution techniques.
Ans: Open addressing, chaining.
4. Write the algorithm for Linear Probing and give an example.
Ans: Sequential search for empty slot.
5. Explain rehashing with an example.
Ans: Increase size, reinsert keys.
6. Discuss array representation and address calculation.
Ans: Formulas for 1D, 2D arrays.
7. Compare linear and binary search algorithms.
Ans: O(n) vs O(log n).
8. Explain bubble, selection, and insertion sort with examples.
Ans: O(n²) sorts.
9. Write short notes on Radix Sort and Shell Sort.
Ans: Radix: O(nk), Shell: O(n log² n).
10. Explain linked list types with diagrams and operations.
Ans: Singly, doubly, circular lists.
Unit III – Linear Data Structures
2 Marks Questions – with concise answers
1. Define a stack.
Ans: LIFO linear data structure.
2. Name two applications of stacks.
Ans: Postfix evaluation, parentheses checking.
3. What is a queue?
Ans: FIFO linear data structure.
4. Name two types of queues.
Ans: Circular queue, Priority queue.
5. Difference between circular and linear queue?
Ans: Last connects to first vs not.
6. What is a doubly linked list?
Ans: Node has previous and next pointers.
7. Write one use of linked lists.
Ans: Dynamic memory allocation.
8. What is a priority queue?
Ans: Queue with priority-based removal.
9. Define polynomial addition in linked lists.
Ans: Adding terms with same exponents.
10. What does BFS stand for?
Ans: Breadth First Search.
10 Marks Questions – with detailed answers
1. Explain stack operations using arrays and linked lists.
Ans: Push/pop logic and complexity.
2. Discuss applications of stacks with examples.
Ans: Expression evaluation, recursion, undo.
3. Explain queue operations using arrays and linked lists.
Ans: Enqueue/dequeue logic.
4. Differentiate between simple, circular, and priority queues.
Ans: Structure and usage differences.
5. Write the algorithm for BFS traversal.
Ans: Queue-based level order traversal.
6. Explain types of linked lists with diagrams.
Ans: Singly, doubly, circular lists.
7. Implement a circular queue using arrays with algorithms.
Ans: Modulo arithmetic usage.
8. Write an algorithm for polynomial addition using linked lists.
Ans: Merge terms by exponents.
9. Discuss advantages and disadvantages of linked lists over arrays.
Ans: Dynamic vs fixed, memory overhead.
10. Explain double-ended queues (Deque) and their operations.
Ans: Insert/delete at both ends.
Unit IV – Non-linear Data Structures
2 Marks Questions – with concise answers
1. Define a tree.
Ans: Hierarchical data structure of nodes and edges.
2. What is a binary tree?
Ans: Each node has at most two children.
3. What is an AVL tree?
Ans: Self-balancing BST with height difference ≤ 1.
4. What is a binary search tree (BST)?
Ans: Left child < parent < right child.
5. What is Huffman coding used for?
Ans: Data compression.
6. Define an expression tree.
Ans: Binary tree for arithmetic expressions.
7. What is a B-tree?
Ans: Balanced search tree with multiple keys per node.
8. What is tree traversal?
Ans: Visiting all nodes in specific order.
9. What is a threaded binary tree?
Ans: Null pointers replaced with traversal links.
10. Define a heap.
Ans: Complete binary tree with heap property.
10 Marks Questions – with detailed answers
1. Explain tree terminology with diagrams.
Ans: Root, leaf, degree, height, depth.
2. Describe binary tree traversal methods with examples.
Ans: Inorder, preorder, postorder.
3. Explain insertion and deletion in a BST.
Ans: Recursive logic for 3 cases.
4. Explain Huffman coding algorithm with example.
Ans: Priority queue merge method.
5. Algorithm for reconstructing binary tree from traversals.
Ans: Preorder root finding method.
6. Discuss AVL tree rotations with examples.
Ans: LL, RR, LR, RL rotations.
7. Explain heap operations with example of heap sort.
Ans: Insert/delete bubble logic.
8. Explain B-tree properties and operations.
Ans: Balanced multiway structure.
9. Explain M-way trees and B* trees.
Ans: Multi-child and high-utilization variants.
10. Algorithm for expression tree evaluation.
Ans: Recursive evaluation of subtrees.
Unit V – Graphs
2 Marks Questions – with concise answers
1. Define a graph.
Ans: Vertices and edges structure.
2. Difference between directed and undirected graphs.
Ans: Edges with/without direction.
3. What is a weighted graph?
Ans: Edges have weights/costs.
4. What is the degree of a vertex?
Ans: Number of incident edges.
5. What is a complete graph?
Ans: Every vertex connected to all others.
6. What is BFS?
Ans: Level-order traversal using a queue.
7. What is DFS?
Ans: Deep traversal using stack/recursion.
8. What is a spanning tree?
Ans: Subgraph with all vertices and no cycles.
9. What is Dijkstra’s algorithm used for?
Ans: Shortest path in weighted graphs.
10. What is adjacency matrix representation?
Ans: 2D array representation of edges.
10 Marks Questions – with detailed answers
1. Explain graph terminology with examples.
Ans: Vertex, edge, path, cycle, connected.
2. Describe adjacency matrix and list representations.
Ans: Dense vs sparse usage.
3. Explain BFS algorithm with example.
Ans: Queue method, O(V+E).
4. Explain DFS algorithm with example.
Ans: Stack/recursion, O(V+E).
5. Differentiate between BFS and DFS.
Ans: Queue vs stack logic.
6. Explain Dijkstra’s shortest path algorithm with example.
Ans: Min distance iterative update.
7. Discuss Kruskal’s MST algorithm.
Ans: Sort edges, union-find method.
8. Discuss Prim’s MST algorithm.
Ans: Grow MST from start vertex.
9. Explain topological sorting with example.
Ans: DAG ordering using DFS or Kahn’s method.
10. Compare Kruskal’s and Prim’s algorithms.
Ans: Edge-based vs vertex-based growth.