Tutorial by Examples

Animation to show how selection sort works The below example shows selection sort in Python def sort_selection(my_list): for pos_upper in xrange( len(my_list)-1, 0, -1): max_pos = 0 for i in xrange(1, pos_upper + 1): if(my_list[i] > my_list[max_pos]): max_po...
Animation to show how selection sort works Below example shows selection sort in ascending order: public class MySelectionSort { public static int[] doSelectionSort(int[] arr){ for (int i = 0; i < arr.length - 1; i++) { int index = i; ...

Page 1 of 1