Q
Hello I have a integer range
[a1 a2]
Now I have another integer range [b1 b2]
ai,bi =0,1,....,M
I wanna compare the relationship between the two ranges
for example
[a1 a2]=[0 99]
[b1 b2]=[20 80]
so there are 9 situations
1) a1=b1, a2<b2
2) a1=b1, a2=b2
....
I'd like to know which situation it belongs to
My current algorithm is to set another array c[2]
if a1<b1 set c[0]=0
if a1=b1 set c[0]=1
if a1>b1 set c[0]=2
if a2<b2 set c[1]=0
if a2=b2 set c[1]=1
if a2>b2 set c[1]=2
decide the situation by c
Is there any better way for it?
Thanks a lot!
[a1 a2]
Now I have another integer range [b1 b2]
ai,bi =0,1,....,M
I wanna compare the relationship between the two ranges
for example
[a1 a2]=[0 99]
[b1 b2]=[20 80]
so there are 9 situations
1) a1=b1, a2<b2
2) a1=b1, a2=b2
....
I'd like to know which situation it belongs to
My current algorithm is to set another array c[2]
if a1<b1 set c[0]=0
if a1=b1 set c[0]=1
if a1>b1 set c[0]=2
if a2<b2 set c[1]=0
if a2=b2 set c[1]=1
if a2>b2 set c[1]=2
decide the situation by c
Is there any better way for it?
Thanks a lot!