Hello,
I have a file with consisted of int;int values in each line. Both columns are ascending, row by row. I plan to load that file into an array with following code:
while( ! feof($f) ) {
$line = fgets( $f, 32 );
$tmp = explode( ";", $line );
$elements[] = array( $tmp[0] => $tmp[1] );
}
I intend to use this array to do a binary search based on the key $tmp[0]. Array will have 1000 elements, but the search will be applied for 10.000 different values. Should I simply define a 2x1000 matrix and load elements into it?
Thx