Assume an array 80 elements and we intend to do bubble sort what is the number of comparison that will take place in the 56th passume (outer loop)
Answers
Answered by
0
Answer:
Explanation:
Complexity Analysis of Bubble Sort
Hence the time complexity of Bubble Sort is O(n2). The main advantage of Bubble Sort is the simplicity of the algorithm. The space complexity for Bubble Sort is O(1), because only a single additional memory space is required i.e. for temp variable.
i hope it helps u
Similar questions