Socials
  • Facebook
  • Twitter
  • Google
  • Linkedin
  • Instagram
  • Youtube
  • 917893489989
  • support@smartgnan.com

Smart Algo

  • Home
  • Sample Topics
    • BubbleSort
    • InsertionSort
    • LinearSearch
    • Stack
    • Queue
  • Pricing
  • Topics
    • Sort
    • Search
    • Stack
    • Queue
    • LinkedList
  • Tutorials
  • Account
  • Log In

BubbleSort

Modal title

BubbleSort

You should see a 'bubble-like' animation if you imagine the larger items 'bubble up' (actually 'float to the right side of the array').

Given an array of N elements, Bubble Sort will:

  1. Compare a pair of adjacent items (a, b),
  2. Swap that pair if the items are out of order (in this case a > b),
  3. Repeat Step 1 and 2 until we reach the end of array
  4. By now, the largest item will be at the last position.
  5. We then reduce N by 1 and repeat Step 1 until we have N = 1.

Invalid Input

BubbleSort
    1x
    • 2x
    • 1.5x
    • 1x
    • 0.5x
    • 0.25x
    • Disclaimers
    • Privacy Policy
    • Term And Conditions
    Hestia | Powered by WordPress