Algorithm: Bubble Sort

Goal: Sort an array of numbers in ascending order using the Bubble Sort technique.

Steps:

  1. Start
  2. Input n (number of elements in the array).
  3. Input the array arr[0…n-1].
  4. Fori = 0 to n-2:
    • Forj = 0 to n-i-2:
      • If arr[j] > arr[j+1]:
        • Swap arr[j] and arr[j+1].
  5. Print the sorted array.
  6. Stop

Flowchart: Bubble Sort

पुढे वाचा

Algorithm: Insertion Sort

Algorithm: Selection Sort

Algorithm: Bubble Sort

Algorithm: Binary Search

Algorithm and flowchart to Search a particular data from the given Array of numbers using: Linear Search Method.

Leave a comment