Arranging in an ordered sequence is called "sorting". Sorting is a common operation in many applications, and efficient algorithms to perform it have been developed.
Problem
Given an array. You need to sort the integers in array with selection sort. And return them in an array.
Selection sort program for selection sort to sort numbers. Selection sort algorithm ...
Given an array of length n + 1, containing elements 1..n and a special character 999 , write a function that sorts the array using only swaps with the special character. In other words, you can only ...
Colleen is turning n years old! Therefore, she has n candles of various heights on her cake, and candle i has height heighti . Because the taller candles tower over the shorter ones, Colleen can on ...
A Hippodrome is organizing a new type of horse racing: duals. During a dual, only two horses will participate in the race. In order for the race to be interesting, it is necessary to try to select tw ...