filmov
tv
Useable Unity. Sorting Algorithms Visualization. Selection Sort. Basics Unity.

Показать описание
Let’s make Selection Sort algorithm visualization using standard Unity2D tools.
The selection sort algorithm sorts an array by repeatedly finding the minimum element from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
1) The subarray which is already sorted.
2) Remaining subarray which is unsorted.
In every iteration of selection sort, the minimum element from the unsorted subarray is picked and moved to the sorted subarray.
"Random Array" button of Unity application generate random scale elements.
"Shuffle Array" button shuffle items of array in random order.
To manual swap items click them.
"Sort Array" button start Selection Sort visualization.
The selection sort algorithm sorts an array by repeatedly finding the minimum element from unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array.
1) The subarray which is already sorted.
2) Remaining subarray which is unsorted.
In every iteration of selection sort, the minimum element from the unsorted subarray is picked and moved to the sorted subarray.
"Random Array" button of Unity application generate random scale elements.
"Shuffle Array" button shuffle items of array in random order.
To manual swap items click them.
"Sort Array" button start Selection Sort visualization.