sorting - Bubble sort and selection sort -


i know key differences between these 2 sorting methods because similar , have got me confused.

for example, if had sorted array:

x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] 

what differences in number of comparisons , movements between using selection , bubble sort on sorted list.

take @ this, visual , audio representation of behavior of different sorting algorithms. entertaining , educational give idea how behave.

http://www.youtube.com/watch?v=t8g-iyghpea

since list provided sorted dealing best case scenario both algorthms, o(n) bubble , o(n^2) selection sort.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -