Liste des Groupes | Revenir à cl c |
On 20/06/2024 16:05, Tim Rentsch wrote:[.. on qsort compare function ..]
>
My reading of the C standard is that the comparison function>
must impose a total ordering on the elements actually present
in the array, or is undefined behavior if it does not. In
other words it's okay if the comparison function doesn't
define a proper order relation, as long as there are no
inconsistencies between values that actually occur in the
particular array being sorted.
Yes, a qsort written in the natural way can getstuck if a
sub0array it considered sorted becmes not sortted on the next
pass.
Les messages affichés proviennent d'usenet.