Click to See Complete Forum and Search --> : Stable sorting algorithms???


Air
02-16-2002, 06:26 PM
Does anyone know the exact definition of a stable sorting algorithm, and is Heap Sort a stable sorting algorithm??
any help is much appreciated.

Grizzly
02-16-2002, 06:45 PM
A "Stable" sorting algorithm leaves the order of equal elements unchanged. A heapsort is not a stable sorting algorithm.

Let me guess, homework? :p

Air
02-17-2002, 05:48 AM
Thank you... that is good cuz I thought it was stable and my heap sort was not sorting it "stabely" (dunno how to spell that).
yup its HW, we are counting the words and their corresponding frequencies in like King James's Bible er some large text file.