Fix missing space between "data" and "structure" in Heap Sort section (#6809) (#6810)

Corrected a typo in the Data Structure and Algorithm roadmap where "datastructure" was incorrectly used. The sentence now reads "It utilizes a data structure known as a ‘binary heap’." This change improves readability and accuracy.
pull/6812/head
Afzal Imdad 3 months ago committed by GitHub
parent a26e391f41
commit 4b7022948a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/105-heap-sort.md

@ -1,3 +1,3 @@
# Heap Sort # Heap Sort
Heap Sort is an efficient, comparison-based sorting algorithm. It utilizes a datastructure known as a 'binary heap', and works by dividing its input into a sorted and an unsorted region, and iteratively shrinking the unsorted region by extracting the largest element and moving that to the sorted region. It's an in-place algorithm but not a stable sort. It involves building a Max-Heap, which is a specialized tree-based data structure, and then swapping the root node (maximum element) with the last node, reducing the size of heap by one and heapifying the root node. The maximum element is now at the end of the list and this step is repeated until all nodes are sorted. Heap Sort offers a good worst-case runtime of O(n log n), irrespective of the input data. Heap Sort is an efficient, comparison-based sorting algorithm. It utilizes a data structure known as a 'binary heap', and works by dividing its input into a sorted and an unsorted region, and iteratively shrinking the unsorted region by extracting the largest element and moving that to the sorted region. It's an in-place algorithm but not a stable sort. It involves building a Max-Heap, which is a specialized tree-based data structure, and then swapping the root node (maximum element) with the last node, reducing the size of heap by one and heapifying the root node. The maximum element is now at the end of the list and this step is repeated until all nodes are sorted. Heap Sort offers a good worst-case runtime of O(n log n), irrespective of the input data.

Loading…
Cancel
Save