Bubble sort

5,955 views

Published on

Bubble sort

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
5,955
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
140
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Bubble sort

  1. 1. Bubble Sort Part 1 of 2 - Series
  2. 2. Overview • Simplest of all sorts • Compare first 2 elements and swap if out of order, keep doing for each adjacent pair of elements until end of array – last element is largest element in array • Do procedure for each next largest element until array is sorted.
  3. 3. Pseudocode
  4. 4. Video Demonstration • Link
  5. 5. Performance Worst case performance: O(n^2) Best case performance O(n)
  6. 6. Improvements • Optimized Bubble Sort • Comb Sort…

×