Successfully reported this slideshow.
Your SlideShare is downloading. ×

SelectionSort.ppt

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 9 Ad

More Related Content

Recently uploaded (20)

Advertisement

SelectionSort.ppt

  1. 1. Selection sort
  2. 2. Selection sort • Algorithm and code for selection sort • Time complexity of the selection sort • Space complexity of selection sort
  3. 3. Code • For i in range(0,n-1) • Min = i • For j in range(i+1,n) • If a[j]<a[min] • Min = j • If (min!=i) • a[i],a[min]=a[min],a[i]
  4. 4. • Time complexity: O(n^2) • Space complexity: O(1)

×