Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!decwrl!shelby!eos!data.nas.nasa.gov!mustang!nntp-server.caltech.edu!manning From: manning@nntp-server.caltech.edu (Evan Marshall Manning) Newsgroups: comp.std.c Subject: Re: qsort(), bsearch(), and rude comparison functions Message-ID: <1990Oct9.231612.10881@nntp-server.caltech.edu> Date: 9 Oct 90 23:16:12 GMT References: <1990Oct6.013443.5364@twinsun.com> <1990Oct9.062455.21197@sq.sq.com> Organization: California Institute of Technology, Pasadena Lines: 17 flee@guardian.cs.psu.edu (Felix Lee) writes: >A pathological comparison function might shuffle the array being >sorted each time it's called, in which case qsort() may never >terminate. Is this prohibited? I myself have used qsort with a comparison function which used rand() to generate a positive or negative number. I was prepared for it to go on forever, but it terminated with the array fully shuffled. *************************************************************************** Your eyes are weary from staring at the CRT for so | Evan M. Manning long. You feel sleepy. Notice how restful it is | is to watch the cursor blink. Close your eyes. The |manning@gap.cco.caltech.edu opinions stated above are yours. You cannot | manning@mars.jpl.nasa.gov imagine why you ever felt otherwise. | gleeper@tybalt.caltech.edu