Re: Arranging the keys problem
- From: Willem <willem@xxxxxxxx>
- Date: Thu, 29 Sep 2005 20:20:26 +0000 (UTC)
mihir wrote:
) There are n keys of different 3 colors say white ,red and blue only.Now
) we have to arrange keys such that red keys come before white ones and
) white ones come before blue keys eg RWWBBB where the keys are placed in
) any random order.Give me a linear time algorithm to solve this problem
) ( O(n)).
Quicksort. You may need a slight tweak to make it linear time.
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: Lars Weber
- Re: Arranging the keys problem
- From: Sc0rpi0
- Re: Arranging the keys problem
- From: Richard Harter
- Re: Arranging the keys problem
- Prev by Date: Beginner needs help with MSB/LSB and 7bit bytes
- Next by Date: Re: Arranging the keys problem
- Previous by thread: Beginner needs help with MSB/LSB and 7bit bytes
- Next by thread: Re: Arranging the keys problem
- Index(es):
Relevant Pages
|