Does an unstable assortment use the same result multiple times for a dataset?

Heapsort is unstable. Does it use on different machines with the same data set the same order in the resulting data set, even if it is unstable?

Edit: An implementation is a C ++ STL heap_sort running on different machines.

+4
source share
3 answers

If you provide the same input for the same implementation, it will produce the same result. This is called "determinism."

, , , (, / bogosort). , (), Heapsort , .

, , . :

. , , . . , : , 5 , , - , .

: , .

" ". . :

 Input 1: 2 1 3 5 4 3
 Input 2: 5 4 3 2 1 3

:

 Result: 1 2 3 3 4 5

, , , 3 ( ).

+4

(Heapsort ), , .

+1

: " ?" . - Quicksort. , , .

, , . , .

+1

All Articles