answersLogoWhite

0

Still curious? Ask our experts.

Chat with our AI personalities

EzraEzra
Faith is not about having all the answers, but learning to ask the right questions.
Chat with Ezra
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
JordanJordan
Looking for a career mentor? I've seen my fair share of shake-ups.
Chat with Jordan
More answers

The complexity of bubble sort is O(n2), also known as exponential complexity. In case this still isn't quite clear, it means that given n elements (for example, 20), it will take, on average, n times n loops (for example, 20 times 20 is 400).

User Avatar

Wiki User

12y ago
User Avatar

The cyclomatic complexity of bubble sort is 4.

User Avatar

Wiki User

12y ago
User Avatar

(n(n+1)) / 2

User Avatar

Wiki User

11y ago
User Avatar

O(n^2)

User Avatar

Wiki User

13y ago
User Avatar

Add your answer:

Earn +20 pts
Q: What is time complexity of bubble sort?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you find the time complexity of a given algorithm?

Time complexity gives an indication of the time an algorithm will complete its task. However, it is merely an indication; two algorithms with the same time complexity won't necessarily take the same amount of time to complete. For instance, comparing two primitive values is a constant-time operation. Swapping those values is also a constant-time operation, however a swap requires more individual operations than a comparison does, so a swap will take longer even though the time complexity is exactly the same.


What is another name for bubble sort?

Bubble sort is also known as sinking sort.


What is the time complexity of radix sort?

If the range of numbers is 1....n and the size of numbers is k(small no.) then the time complexity will be theta n log..


How do you select pivot in quick sort?

quick sort has a best case time complexity of O(nlogn) and worst case time complexity of 0(n^2). the best case occurs when the pivot element choosen as the center or close to the center element of the list.the time complexity can be derived for this case as: t(n)=2*t(n/2)+n. whereas the worst case time complexity for quick sort happens when the pivot element is towards the end of the list.the time complexity for this can be derived using the recurrence eqn: t(n)=t(n-1)+n


Is it trueThe biggest advantage of the bubble sort algorithm is that values move only by one element at a time toward their final destination in the array?

This is false. The movement described is a disadvantageof bubble sort.