Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Algorithm: selectionSort
- VAR : A[N], i=0, j, stop, cache, r : int
- Begin
- Do
- stop <- 1
- For j <- 1+i to N do
- cache <- A[j]
- If(cache>A[j])
- cache <- A[j]
- r <- j
- stop <- 0
- end if
- end for
- A[r] <- A[i+1]
- A[i+1] <- cache
- i <- i+1
- While(stop=0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement