QB / QB64 Discussion Forum      Other Subforums, Links and Downloads
 Return to Index  

Re: What do you call a sort routine with no elements?

April 26 2006 at 6:49 PM
Moneo  (no login)


Response to What do you call a sort routine with no elements?

Out of sorts --- that's funny, Pete.

Actually, many sort algorithms don't test for no elements, or only one element, and will fail.

The same holds true for many merge algorithms which don't sequence check the data files being merged. Many of these merge algorithms will also fail if either or both data files are empty.

You always have to check for everything. If it's possible, it will happen sometime. I used to be criticised for sequence checking a file that just came out of a sort utility. Well, one day the sort failed without my knowledge, and the resultant unsorted file screwed up my whole process. Never again, detect it and abort.
*****



 
 Respond to this message   
Responses

Newbies usually go to www.qbasic.com and click on The QBasic Forum
Forum regulars have their own ways, which include The QBasic Community Forums