Sort the given string using character search | GeeksforGeeks

preview_player
Показать описание

This video is contributed by Ishmeet Kaur.

Please Like, Comment and Share the Video among your friends.

Install our Android App:

If you wish, translate into local language and help us reach millions of other geeks:

Follow us on Facebook:

And Twitter:

Also, Subscribe if you haven't already! :)
Рекомендации по теме
Комментарии
Автор

create an array of 26 counts then run through the string once counting the number of each character; then run through the array of counts adding the corresponding character count number of times. The algorithm runs in 26 + n instead of 26 * n. Yes, you still have to append a character <count> times but it's still fewer iterations, and you can use string(count, chr); (in C++)

xf
Автор

How can you compare string with integer????

Suraj-sirc
Автор

It was good but if possible
Please share a better solution.

casual_chess
visit shbcf.ru