Sorting Strings: Selection Sort

preview_player
Показать описание
A simple example of using selection sort to sort a vector of strings in c++.

Music:
Chibi Ninja - (Erik Skiff)
Рекомендации по теме
Комментарии
Автор

how would you sort like this using the strings the user has entered instead of something with the words already being in the code?

jacksonwilcox
Автор

You forgot to reset the "smallest" to the value of i after each iteration in the i for loop. Orelse the value of "smallest" stays at the position of the last iteration's minimum string. It just so happens that your example worked, but your current code doesn't always work.

Thewowhahahawow
Автор

how do i sort a list of string arrays in alphabetical order? By only comparing the first element of each array.

kvasir
Автор

what was that you typed at the end to make it display in abc order you didnt explain that part

sweetraine