kzhereb / kpi-acts-ta2020

Materials for "Algorithm theory" course
MIT License
0 stars 0 forks source link

D04.14. Advantages and disadvantages of non-comparison sorts (radix sort, counting sort, bucket sort, …)? #24

Open Aziull opened 4 years ago

Aziull commented 4 years ago

D04.14. Advantages and disadvantages of non-comparison sorts (radix sort, counting sort, bucket sort,…)? These were discussed during lectures:

Advantages: •Work for linear time •Do not need comparators (also drawback?)

Disadvantages: •need extra memory •some extra is needed information about objects •the key cannot be changed sorting •work very slowly for large quantities unique items (or if others are violated requirements) •Vulnerable

D04.14. Переваги та недоліки non-comparisonsorts (radix sort, counting sort, bucket sort, …)?

Це було обговорено під час лекції:

Переваги: •Працюють за лінійний час •Не потребують компараторів (також і недолік?)

Недоліки: •потребують додаткової пам'яті •необхідна якась додаткова інформація про об'єкти •неможливо змінити ключ сортування •дуже повільно працюють для великої кількості унікальних елементів (або якщо порушені інші вимоги) •Вразливі

DmytroTarasov commented 4 years ago

Advantages of radix sort It is stable because it preserves existing order of equals keys. It is good on small keys. Disadvantages of radix sort It is not efficient on very long keys because the total sorting time is proportional to key length and to the number of items to sort. We have to write an unconventional compare routine. It requires fixed size keys and some standard way of breaking the keys to pieces.

Yuliiaa commented 4 years ago

Переваги:

Недоліки: