+ 3
đWhy the time taken by BUBBLE SORT is so much higher than other sorting algorithms?đđą
2 Respostas
+ 2
Bubble sort has the worst time complexity of all sorting algorithms, O(nÂČ)
You are comparing each element with every other, and you typically swap one element multiple times. https://en.m.wikipedia.org/wiki/Bubble_sort
+ 2
Bubble sort is a simple and easy to understand algorithm which comes at a cost of bad time complexity of (O(nÂČ)), making it suitable for beginners who don't know concepts like stacks, queues, recursion etc. used to implement more complex algorithms.