n=edit&section=29
"Edit section: C library") ]  C library

Defined in header ` [ <cstdlib> ](/w/cpp/header/cstdlib "cpp/header/cstdlib")
`  
---  
[ qsort  ](/w/cpp/algorithm/qsort "cpp/algorithm/qsort") |  sorts a range of elements with unspecified type   
(function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_qsort&action=edit)  
[ bsearch  ](/w/cpp/algorithm/bsearch "cpp/algorithm/bsearch") |  searches an array for an element of unspecified type   
(function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/algorithm/dsc_bsearch&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/algorithm&action=edit&section=30
"Edit section: Defect reports") ]  Defect reports

The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.

DR  |  Applied to  |  Behavior as published  |  Correct behavior   
---|---|---|---  
[ LWG 193 ](https://cplusplus.github.io/LWG/issue193) |  C++98  |  heap required  *  first  to be the largest element  |  there can be elements   
equal to  *  first  
[ LWG 2150 ](https://cplusplus.github.io/LWG/issue2150) |  C++98  |  the definition of a sorted sequence was incorrect  |  corrected   
[ LWG 2166 ](https://cplusplus.github.io/LWG/issue2166) |  C++98  |  the heap requirement did not match the   
definition of [ max heap ](https://en.wikipedia.org/wiki/Binary_heap "enwiki:Binary heap") closely enough  |  requirement improved   
  
###  [ [ edit ](/mwiki/index.php?title=cpp/algorithm&action=edit&section=31
"Edit section: See also") ]  See also

[ C documentation ](/w/c/algorithm "c/algorithm") for  Algorithms  
---  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/algorithm&oldid=170711
](https://en.cppreference.com/mwiki/index.php?title=cpp/algorithm&oldid=170711)
"

#####  Navigation

  * [ Support us ](http://www.cppreference.com/support)
  * [ Recent changes ](/w/Special:RecentChanges "A list of recent changes in the wiki \[r\]")
  * [ FAQ ](/w/Cppreference:FAQ)
  * [ Offline version ](/w/Cppreference:Archives)

#####  Toolbox

  * [ What links here ](/w/Special:WhatLinksHere/cpp/algorithm "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/algorithm "Recent changes in pages linked from this page \[k\]")
  * [ Upload file ](http://upload.cppreference.com/w/Special:Upload "Upload files \[u\]")
  * [ Special pages ](/w/Special:SpecialPages "A list of all special pages \[q\]")
  * [ Printable version ](/mwiki/index.php?title=cpp/algorithm&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mwiki/index.php?title=cpp/algorithm&oldid=170711 "Permanent link to this revision of the page")
  * [ Page information ](/mwiki/index.php?title=cpp/algorithm&action=info)

  * In other languages 

  * [ العربية ](http://ar.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Deutsch ](http://de.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Español ](http://es.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Français ](http://fr.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Italiano ](http://it.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ 日本語 ](http://ja.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Português ](http://pt.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Русский ](http://ru.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ Türkçe ](http://tr.cppreference.com/w/cpp/algorithm "cpp/algorithm")
  * [ 中文 ](http://zh.cppreference.com/w/cpp/algorithm "cpp/algorithm")

  * This page was last modified on 8 April 2024, at 19:17. 
  * This page has been accessed 3,987,999 times. 

  * [ Privacy policy ](/w/Cppreference:Privacy_policy "Cppreference:Privacy policy")
  * [ About cppreference.com ](/w/Cppreference:About "Cppreference:About")
  * [ Disclaimers ](/w/Cppreference:General_disclaimer "Cppreference:General disc