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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:55:18+00:00 2026-06-14T06:55:18+00:00

I can’t find any information regarding what sorting algorithm C qsort function uses. Is

  • 0

I can’t find any information regarding what sorting algorithm C qsort function uses.

Is it quicksort? It is not mentioned in man.

  • 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-14T06:55:19+00:00Added an answer on June 14, 2026 at 6:55 am

    The implementation of qsort is not specified: an implementation may use any sorting algorithm. Interestingly, the sort does not need to be stable, and there is no complexity requirement.

    The entire specification of qsort (C11 §7.22.5.2) is as follows:

    The qsort function

    Synopsis

    #include <stdlib.h>
    void qsort(void *base, size_t nmemb, size_t size,
         int (*compar)(const void *, const void *));
    

    Description

    The qsort function sorts an array of nmemb objects, the initial element of which is
    pointed to by base. The size of each object is specified by size.

    The contents of the array are sorted into ascending order according to a comparison function pointed to by compar, which is called with two arguments that point to the objects being compared. The function shall return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

    If two elements compare as equal, their order in the resulting sorted array is unspecified.

    Returns

    The qsort function returns no value.

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

Sidebar

Related Questions

Can any one help me in sorting this out in sed/awk/perl Input file Start
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can not find scala.actors package in latest milestones, while it still presents in scaladocs:
Can any one tell me why AES encryption Algorithm is more efficient to use
Can any one tell, how to get the result of LINQ query contains group
Can I be sure about the order in a Python dictionary? The function op.GetTangent(id)
Can any one tell me clearly why ? Reading is simple in ArrayList,( we
Can anyone help me as what is going wrong here? Am not able to
Can somebody help me convert this VB function to Perl (PHP, Ruby or Python
Can anyone tell me how an IDE like NetBeans or any for that matter

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.