Subj : Re: resolving a list of numbers to a range To : comp.programming From : Espen Suenson Date : Thu Aug 18 2005 11:43 am placid wrote: > Hi all, > > I was just if anyone knows a way to resolve a list of integers say > {1,2,3,4,5} into a range that is 1-5? Here's an algorithm: 1) Find the smallest integer in the list, this is A. 2) Find the largest integer in the list, this is B. 3) Return the range A-B. One way of doing steps 1 and 2 is to sort the list. Then the smallest integer will be the first element and the largest integer will be the last element in the list. \Espen -- Numbers are the free creation of the human mind. Julius Wilhelm Richard Dedekind .