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

  • SEARCH
  • Home
  • 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 7863389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:28:00+00:00 2026-06-02T23:28:00+00:00

L1 = [9, 8, 7, 6, 5, 4, 3, 2, 1] L2 = [8,

  • 0

L1 = [9, 8, 7, 6, 5, 4, 3, 2, 1]
L2 = [8, 1, 3, 6, 9, 7, 4, 2, 5]

Would L1 cause bubblesort to do more swaps since the elements are in non-ascending order? I don’t really understand what determines bubblesort to do more/less swaps.

  • 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-02T23:28:02+00:00Added an answer on June 2, 2026 at 11:28 pm

    Yes, L2 would make Bubble-sort do more swaps. Bubble-sort is seriously slowed down by turtles (i.e., small numbers near the end of the list). Rabbits (i.e., large numbers near the beginning of the code) get swapped quickly and don’t matter while turtles move forward in the list slowly, once w/ every iteration.

    That’s why you almost never never use bubblesort in any heavy-duty sorting code. Introsort and Cocktail Sort are better variations of bubble-sort.

    I don’t get why you’re asking this question here, and why you’ve tagged this question w/ python (though that is the only reason I saw this question in the first place).

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

Sidebar

Related Questions

I am trying to understand why including iosfwd would cause output streams including standard
Would the code bellow cause my code to leak? More specifically, am I responsible
The following would cause stack overflow for large 'n', and I can understand why.
i would like to display letters ether they are in ascending order or not
Is there any reason why printw() would cause a segmentation fault? Code is fine
What would possibly cause a 'git push' to try and commit to two branches?
Does dependency injection potentially cause large overhead? I would imagine so, especially if the
One obvious way to cause a stack overflow and get Segmentation fault would be
Rails 3.1.3 and/or 3.2.2. I am unable to determine the cause, would be grateful
What would cause the SVN Move versioned files here command with Tortoise SVN to

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.