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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:53:30+00:00 2026-05-26T06:53:30+00:00

Is there a sort of an array that works in O(n*log(n)) worst case time

  • 0

Is there a sort of an array that works in O(n*log(n)) worst case time complexity?

I saw in Wikipedia that there are sorts like that, but they are unstable, what does that mean? Is there a way to do in low space complexity?

Is there a best sorting algorithm?

  • 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-26T06:53:30+00:00Added an answer on May 26, 2026 at 6:53 am

    An algorithm that requires only O(1) extra memory (so modifying the input array is permitted) is generally described as “in-place”, and that’s the lowest space complexity there is.

    A sort is described as “stable” or not, according to what happens when there are two elements in the input which compare as equal, but are somehow distinguishable. For example, suppose you have a bunch of records with an integer field and a string field, and you sort them on the integer field. The question is, if two records have the same integer value but different string values, then will the one that came first in the input, also come first in the output, or is it possible that they will be reversed? A stable sort is one that guarantees to preserve the order of elements that compare the same, but aren’t identical.

    It is difficult to make a comparison sort that is in-place, and stable, and achieves O(n log n) worst-case time complexity. I’ve a vague idea that it’s unknown whether or not it’s possible, but I don’t keep up to date on it.

    Last time someone asked about the subject, I found a couple of relevant papers, although that question wasn’t identical to this question:

    How to sort in-place using the merge sort algorithm?

    As far as a “best” sort is concerned – some sorting strategies take advantage of the fact that on the whole, taken across a large number of applications, computers spend a lot of time sorting data that isn’t randomly shuffled, it has some structure to it. Timsort is an algorithm to take advantage of commonly-encountered structure. It performs very well in a lot of practical applications. You can’t describe it as a “best” sort, since it’s a heuristic that appears to do well in practice, rather than being a strict improvement on previous algorithms. But it’s the “best” known overall in the opinion of people who ship it as their default sort (Python, Java 7, Android). You probably wouldn’t describe it as “low space complexity”, though, it’s no better than a standard merge sort.

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

Sidebar

Related Questions

Is there any EASY way to sort an array in descending order like how
is there a way in Scala to sort an array of tuples using and
Is there a better way to shell sort using C#? // array of integers
I managed to sort out the calculation but there is just one last question
I have an array of pointers to Objective-C objects. These objects have a sort
Is there any sort of free control which does what the Occupation field does
Is there some sort of formatting protocol for html email? We have an automated
Is there some sort of profiling tool available? View source and search/replace?
Is there some sort of built-in authentication in WCF? I need to expose a
Is there any sort of plug-in or tool available for Visual Studio 2008 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.