On Friday 18 May 2001 06:16, MaD dUCK wrote:
also sprach Zak Greant (on Thu, 17 May 2001 09:35:18PM -0600):
Or just use a simple chain of if statements :)
yeah, but that's so O(n) !
i can do in O(lg n)
or, given n CREW processors, in O(1) time!
yes, i have just finished my computational
also sprach Joseph Blythe (on Fri, 18 May 2001 02:29:40PM +0930):
I give these ideas a go unfortunately the ranges are not contiguous,
they are all over the place.
so you make new ranges to fill spaces and associate a bool with
each... or you check them linearly...
martin;
also sprach Zak Greant (on Thu, 17 May 2001 11:50:35PM -0600):
Do you really need a chainsaw to cut a piece of cake? ;)
hehe. depends.
and come on, i simultaneously have a point and am joking...
martin; (greetings from the heart of the sun.)
\ echo mailto: !#^.*|tr *
hello,
How do I find if a number is in a range example:
0200-0299
1000-2263
2264-2499
Lets say I choose 203 how would find which number range it was in?
I was sort of thinking of using arrays of all the number ranges and
using the in_array function to find which range the numbers are in, but
also sprach Joseph Blythe (on Fri, 18 May 2001 11:12:23AM +0930):
How do I find if a number is in a range example:
assuming that the ranges are continuous, make an array of the first
number for each range and then implement a custom binary search for
O(lg n) performance.
martin;
Or just use a simple chain of if statements :)
if ($num = 200 $num = 299) {
echo $num is between 200 and 299;
} else if ($num =1000 $num = 2263) {
echo $num is between 1000 and 2263;
} else if ($num =2264 $num = 2499) {
echo $num is between 2264 and 2499;
} else {
echo $num is
also sprach Zak Greant (on Thu, 17 May 2001 09:35:18PM -0600):
Or just use a simple chain of if statements :)
yeah, but that's so O(n) !
i can do in O(lg n)
or, given n CREW processors, in O(1) time!
yes, i have just finished my computational theory and computer
algorithms honors exam.
MaD dUCK wrote:
also sprach Zak Greant (on Thu, 17 May 2001 09:35:18PM -0600):
Or just use a simple chain of if statements :)
yeah, but that's so O(n) !
i can do in O(lg n)
or, given n CREW processors, in O(1) time!
yes, i have just finished my computational theory and computer
MaD dUCK wrote:
also sprach Zak Greant (on Thu, 17 May 2001 09:35:18PM -0600):
Or just use a simple chain of if statements :)
yeah, but that's so O(n) !
i can do in O(lg n)
or, given n CREW processors, in O(1) time!
yes, i have just finished my computational theory and computer
9 matches
Mail list logo