From: "Tony Thigpen" <t...@vse2pdf.com>
Sent: Friday, October 25, 2013 11:35 AM


Repost the code. Nothing I still have in my inbox shows code to perform
a binary search of a table where each row occurrence can be any length.

Array c has lower bound 0, upper bound n:
i = -1; k = n+1; /* pointers that always point beyond the smallest and largest 
values */
do while (i+1 < k);
  m = isrl(i+k,1);
  if c(m) > j then k = m;
  else if c(m) < j then i = m;
  else return (m); /* element found */
end;
return (-1); /* element not found. */

Reply via email to