|
-
June 2nd, 2009, 10:35 PM
#1
Array competition
If I have 2 arrays how can that be compared in an infite loop ?
The longer the loop takes the more fruitful outcomes I can obtain, right ?
So tell me what is the payoff ?
-----
-
June 2nd, 2009, 11:14 PM
#2
Re: Array competition
 Originally Posted by yuenqi
If I have 2 arrays how can that be compared in an infite loop ?
The longer the loop takes the more fruitful outcomes I can obtain, right ?
So tell me what is the payoff ?
I did'nt get what are you trying to do... Infinite loop..??? Why..???
Post any code snippet... !!!
-
June 3rd, 2009, 01:28 AM
#3
Re: Array competition
 Originally Posted by yuenqi
If I have 2 arrays how can that be compared in an infite loop ?
The longer the loop takes the more fruitful outcomes I can obtain, right ?
So tell me what is the payoff ?
Arrays are sequences with a fixed, finite length. I don't see how it makes sense to compare them in an infinite look.
-
June 3rd, 2009, 03:19 AM
#4
Re: Array competition
Well, the question is very hard to understand, so I could only guess what OP meant. So some thoughts:
- Arrays *differ* is they have different length.
- Arrays *differ* if at least one element in the first array is not equal to any element in another array.
So, to compare them:
- compare the length
- if both have the same length - sort elements in both arrays and compare them per-element until the end of arrays or until the element will be different
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|