
December 13th, 2004, 07:30 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 8
Time spent in forums: 8 h 42 m
Reputation Power: 0
|
|
|
Comparing 2 Arrays (unconventional)
Hi all. Firstly many thanks for all those who have posted, some great material on this forum.
My current problem is comparing two arrays, however it has a bit of a difference to the 'standard' array comparison problem.
E.g.:
Array A has 400 elements. Each element contains a range of values that a secondary array must be evaluated to (in other words, Array A is the baseline).
value of array_A[0] element is defined as a value in the range [1996, 4095].
value of array_A[1] element is defined as a value in the range [1, 31].
So on and so forth with some 400 elements.
The objective is to compare Array B to the Array A paramters and to determine whether the corresponding element is within the given range.
mathematically, if (1995 < array_B[0] < 4096) then = true.
I do have some code for it, but it is extremely inefficient and simply inappropriate to use for arrays of over 1000 elements.
The range parameters must also be easily accessible for modification in the future, so the range definition for the required paramter should not be buried in xxx lines of code (preferably of course).
|