kzhereb / kpi-acts-ta2020

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

D04.3. Переваги та недоліки Bubble sort? #32

Open IllyaKamen opened 4 years ago

IllyaKamen commented 4 years ago

D04.3. Переваги та недоліки Bubble sort (укр) Переваги:

Недоліки

D04.3. Переваги та недоліки Bubble sort (eng) Advantages

Недоліки

IllyaKamen commented 4 years ago

Advantages: It is simple to write, easy to understand and it only takes a few lines of code. The data is sorted in place so there is little memory overhead. The only extra memory it requires is that of the temporary value created when swapping adjacent elements. It’s also sable, as the order of identical items doesn’t change while the array is being sorted. Disadvantages: It’s time-inefficient (Time Complexity: O(n^2)) which is the major disadvantage. The average time increases almost exponentially as the number of table elements increase. Also if the code isn’t optimized – the loop continues to run, even if the array is sorted (If there is no swapping in a particular pass, it means the array has become sorted, so we should not perform the further passes.)

glbter commented 4 years ago

Переваги

Недоліки

RedBarboriska commented 4 years ago

Переваги

Недоліки

Edward3635 commented 4 years ago

Переваги алгоритму:

простота реалізації алгоритму;

моделює природну поведінку людини, яка здійснює сортування вручну.

Його недоліки: не ефективний, якщо необхідно відсортувати масив великого розміру.

ZinchenkoArtem1 commented 4 years ago

Advantages

Disadvantages

YevgeniyBukur commented 4 years ago

image

Di-kurdii commented 4 years ago

Преимущества: легко понять, не занимает дополнительной памяти, легкий в исполнении, является быстрым для малых массивов, не требует дополнительной памяти, является stream-out.

Недостатки: O (n2) в худшем и среднем случае - медленный, без использования улучшений не является адаптивным, не справляется с большим набором данных.