Re: Arranging the keys problem
- From: Willem <willem@xxxxxxxx>
- Date: Fri, 30 Sep 2005 10:56:45 +0000 (UTC)
Richard wrote:
) Quicksort is an overkill. The canonical in place O(n) solution is the
) Dutch Flag Algorithm which, in the better quicksort implementations is
) known as fat pivot partitioning. The point is that the first
) partitioning pass suffices to solve the problem.
That would be the slight tweak I was referring to. :-)
As an aside: this was probably a homework question from a class, that is
leading up to quicksort. The fact that he wanted to sort red, white and
blue is a dead giveaway that Dutch National Flag is the intended solution.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.
- Follow-Ups:
- Re: Arranging the keys problem
- From: Willem
- Re: Arranging the keys problem
- References:
- Re: Arranging the keys problem
- From: Willem
- Re: Arranging the keys problem
- From: Richard Harter
- Re: Arranging the keys problem
- Prev by Date: Re: Reverse words in a string (Another Interview question)
- Next by Date: Re: Arranging the keys problem
- Previous by thread: Re: Arranging the keys problem
- Next by thread: Re: Arranging the keys problem
- Index(es):
Relevant Pages
|