Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs Heaps and Hashing

CSE205 — Data Structures And Algorithms 50 questions. Pick an option to check it.

Read the notes

0 of 50 answered 0 right 0 wrong , 50 left

  1. Question 1 of 50

    In a Max-Heap, what is the relationship between the value of a node and its children?

  2. Question 2 of 50

    Which data structure is commonly used to implement a Heap efficiently?

  3. Question 3 of 50

    If a node is stored at index 'i' in an array representation of a binary heap (0-indexed), what is the index of its left child?

  4. Question 4 of 50

    What is the time complexity to insert a new element into a binary heap of size N?

  5. Question 5 of 50

    What is the time complexity to find the maximum element in a Max-Heap?

  6. Question 6 of 50

    Which operation is required to restore the heap property after extracting the root element?

  7. Question 7 of 50

    A binary heap is strictly a __.

  8. Question 8 of 50

    What is the parent index of a node at index 'i' in a 0-indexed array heap?

  9. Question 9 of 50

    What is the worst-case time complexity of HeapSort?

  10. Question 10 of 50

    HeapSort is generally considered stable. True or False?

  11. Question 11 of 50

    Which of the following scenarios is the best use case for a Heap?

  12. Question 12 of 50

    What is the time complexity to build a heap from an unsorted array of N elements?

  13. Question 13 of 50

    In HeapSort, where is the sorted array constructed?

  14. Question 14 of 50

    What is the height of a binary heap with N nodes?

  15. Question 15 of 50

    Which hashing technique allows multiple keys to be stored in the same slot using a data structure like a linked list?

  16. Question 16 of 50

    What is a 'Collision' in hashing?

  17. Question 17 of 50

    In the context of hash tables, what is the Load Factor (alpha)?

  18. Question 18 of 50

    Which simple hash function is defined as h(k) = k mod m?

  19. Question 19 of 50

    In Open Addressing, where are colliding elements stored?

  20. Question 20 of 50

    What is the probe sequence for Linear Probing?

  21. Question 21 of 50

    What is the main disadvantage of Linear Probing?

  22. Question 22 of 50

    Quadratic Probing reduces primary clustering but suffers from which issue?

  23. Question 23 of 50

    Which collision resolution technique uses a second hash function?

  24. Question 24 of 50

    In Double Hashing, what property must the second hash function h2(k) have?

  25. Question 25 of 50

    Which hashing method allows the load factor to exceed 1?

  26. Question 26 of 50

    What is the worst-case search time in a Hash Table using Separate Chaining?

  27. Question 27 of 50

    What is the average-case search time for a well-implemented hash table?

  28. Question 28 of 50

    What technique is used to handle deletions in Open Addressing tables?

  29. Question 29 of 50

    When choosing a table size 'm' for the Division Method (h(k) = k % m), 'm' should preferably be:

  30. Question 30 of 50

    In the Mid-Square method of hashing, which part of the squared key is usually taken as the hash?

  31. Question 31 of 50

    What happens when the load factor of a hash table becomes too high?

  32. Question 32 of 50

    The process of increasing the size of a hash table and re-inserting all existing elements is called:

  33. Question 33 of 50

    Which probing method uses the formula H(k, i) = (h(k) + c1i + c2i^2) % m?

  34. Question 34 of 50

    What is 'Perfect Hashing'?

  35. Question 35 of 50

    If we have a Max-Heap array: [100, 80, 90, 40, 50, 70], what is the left child of 80?

  36. Question 36 of 50

    In a Min-Heap, the root node always contains:

  37. Question 37 of 50

    Which of the following is NOT a requirement for a good hash function?

  38. Question 38 of 50

    In Open Hashing (Separate Chaining), if the table size is 10 and we insert 20 elements, the load factor is:

  39. Question 39 of 50

    What is the relationship between Open Hashing and Closed Addressing?

  40. Question 40 of 50

    In Linear Probing, search for a key stops when:

  41. Question 41 of 50

    Which operation is typically faster in a Hash Table compared to a Binary Search Tree (BST)?

  42. Question 42 of 50

    When performing HeapSort on an array in ascending order, which type of heap is typically used?

  43. Question 43 of 50

    In the folding method of hashing, the key is:

  44. Question 44 of 50

    What is the primary benefit of Double Hashing over Quadratic Probing?

  45. Question 45 of 50

    If a hash table using Open Addressing is full, what is the time complexity to insert a new item?

  46. Question 46 of 50

    For string keys, a common hashing approach involves:

  47. Question 47 of 50

    Which heap operation decreases the value of a key and restores the heap property?

  48. Question 48 of 50

    In a hash table with size m = 10 and hash function h(k) = k % 10, where does key 23 go?

  49. Question 49 of 50

    Using Linear Probing with h(k) = k % 10, if slots 2 and 3 are occupied, where does key 12 go?

  50. Question 50 of 50

    What is the space complexity of a binary heap?

That's unit 5

Answer a few questions and your score shows up here.