From 4b7022948a5504608410ae9a6e53320a427f12f0 Mon Sep 17 00:00:00 2001 From: Afzal Imdad <122292180+afzalimdad9@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:16:52 +0500 Subject: [PATCH] Fix missing space between "data" and "structure" in Heap Sort section (#6809) (#6810) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../content/105-sorting-algorithms/105-heap-sort.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/105-heap-sort.md b/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/105-heap-sort.md index dae4aec60..382b6f8c5 100644 --- a/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/105-heap-sort.md +++ b/src/data/roadmaps/datastructures-and-algorithms/content/105-sorting-algorithms/105-heap-sort.md @@ -1,3 +1,3 @@ # 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.