Which of the following sorting algorithms users recursion ?

Which of the following sorting algorithms users recursion ?

Answer: C. Merge sortHeap sort: This algorithm uses a heap data structure, which is a complete binary tree. It repeatedly extracts the maximum (or minimum) element and reorganizes…

  1. A.

    Heap sort

  2. B.

    Bubble sort

  3. C.

    Merge sort

  4. D.

    Insertion sort

Attempted by 594 students.

Show answer & explanation

Correct answer: C

Heap sort: This algorithm uses a heap data structure, which is a complete binary tree. It repeatedly extracts the maximum (or minimum) element and reorganizes the heap. The process is iterative and does not involve recursive function calls.

Bubble sort: This algorithm repeatedly compares adjacent elements and swaps them if they are in the wrong order. It continues until the array is sorted. It uses loops and does not use recursion.

Insertion sort: This algorithm builds the sorted array one element at a time by inserting each element into its correct position in the already sorted portion. It uses nested loops and does not use recursion.

Merge sort: This algorithm follows a divide-and-conquer approach. It divides the array into two halves, recursively sorts each half, and then merges the sorted halves. The recursive nature of this algorithm is essential to its operation.

Explore the full course: Accenture Preparation

Loading lesson…