0% found this document useful (0 votes)
6 views3 pages

Heap-Sort-Quiz1

The document is a quiz on Heap Sort, covering key concepts such as its definition, data structures, properties of heaps, time and memory complexities, and the sorting process. It includes multiple-choice questions that test understanding of Heap Sort's mechanics and comparisons to other sorting algorithms. The quiz is authored by Franco, Gamueda, and Sioc.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Heap-Sort-Quiz1

The document is a quiz on Heap Sort, covering key concepts such as its definition, data structures, properties of heaps, time and memory complexities, and the sorting process. It includes multiple-choice questions that test understanding of Heap Sort's mechanics and comparisons to other sorting algorithms. The quiz is authored by Franco, Gamueda, and Sioc.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Heap Sort Quiz

Reported by : Franco, Gamueda, & Sioc.

1. What is Heap Sort?


A. A recursive sorting algorithm that uses merge operations.
B. A comparison-based sorting algorithm that uses a binary heap.
C. A sorting algorithm based on partitioning the dataset.
D. A string sorting algorithm.

2. What data structure does Heap Sort rely on?


A. Linked List
B. Binary Heap
C. Stack
D. Graph

3. Which heap property does a Max Heap satisfy?


A. Parent nodes are greater than or equal to their child nodes.
B. Parent nodes are less than or equal to their child nodes.
C. Parent nodes are equal to their child nodes.
D. Parent nodes are randomly ordered.

4. What is the time complexity of Heap Sort in all cases?


A. O(n²)
B. O(n log n)
C. O(log n)
D. O(1)

5. What does "heapify" do?


A. Converts an unsorted array into a sorted one.
B. Restores the heap property of a binary heap.
C. Merges two heaps into one.
D. Divides the heap into sorted and unsorted parts.

6. How does Heap Sort handle the largest element in the heap?
A. Moves it to the root of the heap.
B. Swaps it with the last element of the heap.
C. Deletes it from the heap.
D. Leaves it in its current position.

7. What is the first step in Heap Sort?


A. Sort the array in ascending order.
B. Build a max heap from the array.
C. Swap all elements in the array.
D. Divide the array into two subarrays.
Heap Sort Quiz
Reported by : Franco, Gamueda, & Sioc.

8. Which type of sorting algorithm is Heap Sort considered?


A. Stable
B. Unstable
C. Recursive
D. External

9. Why is Heap Sort considered memory-efficient?


A. It requires no extra memory beyond the input array.
B. It uses a separate array for the sorted elements.
C. It compresses the dataset before sorting.
D. It stores elements in a linked list.

10. What happens after the root element of the heap is swapped with the last element?
A. The heap is sorted.
B. The heap is heapified, excluding the swapped element.
C. The heap size increases.
D. The heap becomes a Min Heap.

11. Sort the array [7, 2, 9, 4, 1] using Heap Sort. What is the sorted array?
A. [7, 9, 4, 2, 1]
B. [9, 7, 4, 2, 1]
C. [1, 2, 4, 7, 9]
D. [2, 4, 7, 9, 1]

12. Which step is NOT part of the Heap Sort process?


A. Build a max heap.
B. Swap the root with the last element.
C. Heapify the array.
D. Merge two heaps.

13. Why is Heap Sort considered inefficient compared to Merge Sort?


A. It has higher constants in its time complexity.
B. It uses more memory.
C. It is recursive.
D. It is stable.

14. What is the memory complexity of Heap Sort?


A. O(1)
B. O(n log n)
C. O(n)
D. O(n²)

15. How does Heap Sort handle unsorted data?


A. Converts it into a Min Heap.
B. Converts it into a Max Heap.
Heap Sort Quiz
Reported by : Franco, Gamueda, & Sioc.

C. Rearranges it in ascending order.


D. Deletes all elements except the largest one.

16. Heap sort is ____ as the constants are higher compare to merge sort

A. Simplicity

B. Costly

C. Unstable

D. Inefficient

17. Heap sort is ___. It might rearrange the relative order.

A. Simplicity

B. Unstable

C. Stability

D. Limbics

18. Heap sort is ______because of the high constants in the time complexity

A. Simplicity

B. Time Complexity

C. Inefficient

D. Efficiency

19. It is simpler to understand than other equally efficient sorting algorithms because it does
not use advanced computer science concepts such as recursion.

A. Simplicity

B. Limbics

C. Bouquet

D. Efficiency

20. Which is NOT a Disadvantage of Heap Sort

A. Costly

B. Inefficient

C. Limbics

D. Unstable

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy