Welcome Guest. Please Login or Register. Apr 1st, 2018, 05:04am
ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018. We apologize Conforums does not have any export functions to migrate data. Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.
Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
Re: Sort behavior
« Reply #1 on: Jun 3rd, 2015, 07:22am »
Richard, please correct me if I am wrong:
not stable means the sequence of items can be altered running Sort a second time this means the sorting is not always 100% correctone would better use something else to sort
I never ran it to this, but maybe it occurs at specific occasions
not stable means the sequence of items can be altered running Sort a second time
No, that's something different. LBB's sort does guarantee that the order remains unchanged on a repeated sort, but it is not a stable sort.
Quote:
this means the sorting is not always 100% correct
Changing the order doesn't mean the sort is incorrect, so long as the items in the sorted column remain sorted. Both LB and LBB sorts are 'correct' - they do what they claim to do - but only LBB's is guaranteed to leave the order unchanged if the sort is repeated.
Quote:
one would better use something else to sort
If you need a stable sort then you would need to use an alternative method. But that is unusual - I don't think I've ever needed a stable sort.