One of the most studied computational problems is the ordering of a collection of values. Ordering is important because many pro blems set on collections of values become easy if the elements of the collection are ordered. Sorting by selection is an example of sorting algorithm.
This algorithm consists of the following steps:
1. It is looked for in the part disordered by the smaller element and it is changed the smaller element with the element under the marker.
2. A marker is used to divide the ordered and disordered parts of the vector. The value 0 is assigned to the bookmark.
3. The marker is advanced.
4. The process repeats until there is only one element from the marker.
Check the alternative that shows the correct ordering of the steps of the sort ordering algorithm.
Alternatives:
The)
1 - 2 - 3 - 4.
B)
1 - 2 - 4 - 3.
w)
2 - 1-4.
(d)
2 - 1-3.
and)
2-3-1-4.
1 answer:
I think the order should be 2-1-3-4, but the description of step 1 is confusing. In selection sort, you iterate from the point of the marker down through the entire list and find the smallest value, and swap that with the value at the marker. Then you advance the marker and repeat the process on the remainder of the list.
You might be interested in
The answer is D, the standard course of action adopted by a business.
A restaurant is a workplace for someone whos career specialty is in... Cooking The answer is: Cooking
The answer would be computer
the fat car has a lot to pass on PC Dell is the only thing to
Joseph Henry in about 1835. He is American and he made something called a relay.