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 6592233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:31:41+00:00 2026-05-25T17:31:41+00:00

Note: Please do not tag this as homework! I am not a student and

  • 0

Note: Please do not tag this as homework! I am not a student and this is not an assignment. I am a software engineer dusting off my old Data Structures & Algorithms textbook and trying to remember stuff I learned years ago and that I cannot seem to find anywhere online.

I recall a specific lecture, and it is reinforced in my textbook, that algorithm bounds (upper, tight and lower) and cases (best, average and worst) are not one in the same. But for the life of me I can’t remember how the two concepts are different.

To me, if some algorithm is O(n) worst-case, then it can perform any worse than some linear function, such as f(n) = cn + k. Since we are guaranteed this in the worst case, it seems to me that its upper-bound is also linear.

I know I’m wrong, I just can’t figure out why.

I’m a contextual learner, so if someone could provide a meaningful example where either worst-case is not upper bound, or best case is not lower bound, or where average case is not tight-bound, that would probably get through to me the fastest.

Thanks for any clarity on this!

  • 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-05-25T17:31:42+00:00Added an answer on May 25, 2026 at 5:31 pm

    Consider a variant of quicksort that checks if the array is already sorted and, if not, sorts using the first element as a pivot.

    The best case is O(n) if the array is already sorted. This is an upper bound on the best-case behavior, which is meaningful if not interesting.

    The average case over random inputs is O(n3/2) and Ω(n). Okay, I cheated slighty because it’s also Theta(n log n), but the idea is that bounds are not always tight, and this lack of tightness may manifest itself when I’m describing average-case bounds.

    The worst case is Theta(n2) if the array is reverse sorted, because the subproblems are so unbalanced (each time, we pivot with the maximum element, resulting in subproblems of sizes 0 and n – 1 instead of about n/2 and about n/2). This is a tight bound on the worst case and shows that the algorithm really can be that bad, but no worse. Quicksort is also O(n3), but not Theta(n3), because quicksort has no family of inputs that results in cubic behavior.

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

Sidebar

Related Questions

Please note that this is not homework and i did search before starting this
Please note this is not a question about online/hosted SVN services. I am working
Please note: This is a question about the Eclipse plugin Subversive , and not
NOTE: I am not exactly sure how to title or tag this question, so
Please note: This question relates to the Appcelerator Titanium platform, not the stock iOS
Please note this code was not written by me. Otherwise I would not be
Please note - I am not looking for the right way to open/read a
[Please note that this is a different question from the already answered How to
Please note that I did ask this on Super User and received absolutely no
Please note that this question is from 2008 and now is of only historic

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.