Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8646291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:46:11+00:00 2026-06-12T12:46:11+00:00

If bubble sort takes 200 sec to sort 200 names then how many items

  • 0

If bubble sort takes 200 sec to sort 200 names then how many items it can sort in 800 secs?

Calculating number of comparisons can give us the solution. How can we calculate the number of comparisons it takes to sort 200 names ? Do we have to consider the best case ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:46:13+00:00Added an answer on June 12, 2026 at 12:46 pm
    1. Bubble sort is O(n2). Do your maths. Big O just gives an idea of relative time, you can guess rough estimate of time. Not exact.
    2. BubbleSort takes n-1 comparisons in first go, n-2 in second, and so on. So you have total (n-1) + (n-2) + .. +1. Do some maths again?
    3. Bubble Sort is so pathetic that there is no best case![1]

    (obviously you can write a smart bubble sort that does not sort an already sorted array)

    BUBBLESORT A
     for i = 1 to A.length 1
      for j = A.length downto i+1
        if A[j]  < A[j - 1]
         exchange A[j] with A[j-1]
    

    from The Introduction to Algorithms – CLRS


    [1] On #3. See http://en.wikipedia.org/wiki/Bubble_sort it mentions an optimized inner loop that identified the sorted remaining array and makes a best case O(n) — sorry about that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain why this bubble sort function doesn't work and why I lose
I have to sort a string of names in descending order in bubble sort.
I have to time how long a bubble sort takes and print how long
This code is a C program (bubble sort) disassembled into assembly. How can I
If this is Bubble sort then what is this ? Do you see the
Bubble sort is O(n) at best, O(n^2) at worst, and its memory usage is
I am doing a bubble sort function and encounter a variable operator problem. There
I'm trying to bubble sort a character array in alphabetic order. My code is
I want to sort array using Bubble Sort. I an missing a small point
I was beginning to write a bubble sort for this when I thought maybe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.