Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

selection sort c++ algorithm

//Selection sort algorithm
selectionSort(array, size)
  repeat (size - 1) times
  set the first unsorted element as the minimum
  for each of the unsorted elements
    if element < currentMinimum
      set element as new minimum
  swap minimum with first unsorted position
end selectionSort
 
PREVIOUS NEXT
Tagged: #selection #sort #algorithm
ADD COMMENT
Topic
Name
1+5 =