Question discussion

In which of the following sorting algorithm, consecutive adjacent pairs of elements in the array are compared with each other?

162633Medium 1 reply 1,088 views
35
In which of the following sorting algorithm, consecutive adjacent pairs of elements in the array are compared with each other?
  • ABubble Sort
  • BInsertion Sort
  • CSelection Sort
  • DHeap Sort
Answer not set

Discussion 1

0
CCommunity
Sorting is an algorithm that arranges the elements of a list in a certain order.

Examples of sorting algorithm:

Bubble sort, Quick sort, Merge Sort, Selection sort, Insertion sort etc.

Bubble sort is the simplest sorting algorithm. It sorts the array elements by repeatedly moving the largest element to the highest index position of the array segment. It works by iterating the input array from the first element to the last, comparing each pair of elements and swapping them if needed.