Bubble Sort

Algorithm

  • Run through the entire list to sort and swap adjacent items if they are in the wrong order.
  • Stop when another pass through the list requires no more swaps.

Performance

  • Worst case: $O(n^{2})$
  • Best case: $O(n)$
  • Average case: $O(n^{2})$
  • Space complexity: $O(1)$

fuss/algorithms/sorting/bubble_sort.txt ยท Last modified: 2017/02/22 18:30 (external edit)

Access website using Tor Access website using i2p


For the copyright, license, warranty and privacy terms for the usage of this website please see the license, privacy and plagiarism pages.