Unit 4: Recursion and Trees - Subjective Questions

CSE205 — Data Structures And Algorithms • Practice Questions with Detailed Answers

20 questions

1

Define recursion. Explain the essential components of a recursive algorithm with a suitable example.

2

Explain how recursive function calls are managed using the call stack. Discuss the advantages and limitations of recursion.

3

Define a binary tree and explain the commonly used terminology associated with binary trees.

4

What is a complete binary tree? Derive the important properties of a complete binary tree containing nodes.

5

Define an extended binary tree. Explain how an ordinary binary tree is converted into an extended binary tree and state its important properties.

6

Describe the linked memory representation of a binary tree. Explain its structure, operations, and memory characteristics.

7

Explain the sequential memory representation of a binary tree. Give the index formulas and discuss its advantages and disadvantages.

8

Compare the linked and sequential memory representations of binary trees.

9

Define a binary search tree and explain its ordering property, major operations, and time complexity.

10

Describe the recursive algorithm for searching in a binary search tree and analyze its complexity.

11

Explain binary search tree insertion using a recursive algorithm. Illustrate the insertion of the keys 50, 30, 70, 20, 40, 60, 80.

12

Explain all cases of deletion from a binary search tree and give a recursive deletion algorithm.

13

Describe in-order traversal using recursion. State its algorithm, output order, applications, and complexity.

14

Describe pre-order traversal using recursion. State its algorithm, output order, applications, and complexity.

15

Describe post-order traversal using recursion. State its algorithm, output order, applications, and complexity.

16

Compare in-order, pre-order, and post-order recursive traversals. Determine all three traversal sequences for a tree whose root is A, whose children are B and C, where B has children D and E, and C has right child F.

17

Explain the recursive solution to the Towers of Hanoi problem. Derive the recurrence relation and the minimum number of moves.

18

Explain merge sort using recursion. Derive its time complexity and discuss its important characteristics.

19

Explain quick sort using recursion and a partitioning procedure. Analyze its best, average, and worst-case complexities.

20

Compare merge sort and quick sort with respect to strategy, complexity, memory usage, stability, and practical applications.