Bubble sort is a simple sorting algorithm that compares the first two elements in the array and keeps hold of the largest, for each pass the largest will 'bubble' to the top. Each pass will require n-i comparisons.
This algorithm is considered O(N^2)
No comments:
Post a Comment