Open IllyaKamen opened 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.)
Переваги
Недоліки
Переваги
Недоліки
Переваги алгоритму:
простота реалізації алгоритму;
моделює природну поведінку людини, яка здійснює сортування вручну.
Його недоліки: не ефективний, якщо необхідно відсортувати масив великого розміру.
Advantages
Disadvantages
Преимущества: легко понять, не занимает дополнительной памяти, легкий в исполнении, является быстрым для малых массивов, не требует дополнительной памяти, является stream-out.
Недостатки: O (n2) в худшем и среднем случае - медленный, без использования улучшений не является адаптивным, не справляется с большим набором данных.
D04.3. Переваги та недоліки Bubble sort (укр) Переваги:
Легкий в реалізації
Легко для розуміння
Краще за богосорт ☺
Недоліки
D04.3. Переваги та недоліки Bubble sort (eng) Advantages
Easy to implement
Worst case known
Недоліки