Unit 5: Heaps and Hashing - Subjective Questions

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

20 questions

1

Define a heap. Explain the structural and ordering properties of min-heaps and max-heaps.

2

Explain how a binary heap is represented using an array. Illustrate the representation with an example.

3

Describe the insertion operation in a max-heap. Show how the element is inserted into the heap .

4

Explain deletion of the root element from a max-heap. Demonstrate the operation on the heap .

5

Describe the bottom-up method of building a heap and derive its time complexity.

6

Explain the heap sort algorithm with its major phases and analyze its time and space complexities.

7

Apply heap sort to the array and show the important intermediate steps.

8

Define hashing, hash function, hash table, and collision. Explain why hashing is useful.

9

What characteristics should a good hash function possess? Explain common methods used to construct hash functions.

10

Explain the division method of hashing. Why is a prime table size generally preferred?

11

Define load factor in hashing. Discuss its effect on the performance of separate chaining and open addressing.

12

Explain open hashing and separate chaining. Describe insertion, search, and deletion using this collision-resolution method.

13

Distinguish between separate chaining and open addressing as collision-resolution techniques.

14

Explain closed hashing or open addressing. How are insertion, search, and deletion performed?

15

Describe linear probing with an example. What is primary clustering?

16

Explain quadratic probing. How does it reduce clustering, and what limitations does it have?

17

Explain double hashing and state the conditions required for a good secondary hash function.

18

Compare linear probing, quadratic probing, and double hashing.

19

Why is deletion difficult in an open-addressed hash table? Explain the role of tombstones.

20

Explain rehashing in hash tables. When is it required, and what steps are involved?