logoSEE ALGORITHMS
Sorting
    Bubble Sort
    Insertion Sort
    Selection Sort
    Radix Sort
    Heap Sort
    Merge Sort
    Quick Sort
    Depth First Search
    Breadth First Search
    Prim's Algorithm
    Kruskal's Algorithm
    Dijkstra's Algorithm
    Topological Sorting
    Hamiltonian Cycle
    Binary Search Tree
    Binary Heap
    Circular Queue
    Convex Hull
    Huffman Coding
Bubble Sort

Bubble Sort is a simple sorting algorithm that works by repeatedly swapping adjacent elements if they are in the wrong order. This process continues until the list is fully sorted. While it’s easy to understand, Bubble Sort is not very efficient for large datasets due to its quadratic time complexity. It’s often used for educational purposes or as a baseline for comparison with other sorting algorithms.

    for i = 1 to (n - 1):
        swapped = false
        for j = 1 to (n - i):
            if arr[j] < arr[j + 1]:
                swap(j, j + 1)
                swapped = true
        if not swapped:
            break
Select number of elements: