From owner-freebsd-questions Sun Sep 30 5:36: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from hotmail.com (f74.pav2.hotmail.com [64.4.37.74]) by hub.freebsd.org (Postfix) with ESMTP id AC20B37B406 for ; Sun, 30 Sep 2001 05:36:02 -0700 (PDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Sun, 30 Sep 2001 05:36:02 -0700 Received: from 203.80.74.169 by pv2fd.pav2.hotmail.msn.com with HTTP; Sun, 30 Sep 2001 12:36:02 GMT X-Originating-IP: [203.80.74.169] From: "Wing Tim" To: freebsd-questions@FreeBSD.ORG Subject: An algorithm to find median Date: Sun, 30 Sep 2001 20:36:02 +0800 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 30 Sep 2001 12:36:02.0437 (UTC) FILETIME=[77185350:01C149AC] Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dear all, On FreeBSD platform, I'm trying a C program to find out the median among 5 elements. I can do so successfully using sorting method in which 7 comparisons was used. However, it is known that there's a method of finding median among 5 elements using at most 6 comparisons. Anyone who remember that? Could you state it here or send me a path which shows the method? Thanks! Regards, Wing _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message