home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!haven.umd.edu!decuac!pa.dec.com!nntpd2.cxo.dec.com!nntpd.lkg.dec.com!math.zk3.dec.com!edp
- From: edp@math.zk3.dec.com (Eric Postpischil)
- Subject: Re: comparison problem
- Message-ID: <1992Nov18.191533.23359@nntpd.lkg.dec.com>
- Sender: usenet@nntpd.lkg.dec.com (USENET News System)
- Reply-To: edp@math.zk3.dec.com (Eric Postpischil)
- Organization: Digital Equipment Corporation
- References: <1992Nov18.161028.11906@seas.gwu.edu>
- Distribution: usa
- Date: Wed, 18 Nov 1992 19:15:33 GMT
- Lines: 16
-
- In article <1992Nov18.161028.11906@seas.gwu.edu>, chihy@seas.gwu.edu
- (Chih-Hsun Yao) writes:
-
- >Describe an algorithm that finds the largest and second largest integer in a
- >set of (2^m) integers using at most m+(2^m)-2 comparisons.
- >(Hint: Consider binary tree tournament)
-
- Bigger hint: Consider recursion. Let f(k)=k+(2^k)-2 and suppose you
- had a procedure that could find the largest and second largest of a set
- of 2^k integers, but the procedure only worked for k < m. Could you
- make a new procedure that worked for k=m?
-
-
- -- edp (Eric Postpischil)
- "Always mount a scratch monkey."
- edp@rusure.enet.dec.com
-