using System;
public class Program
{
public static void Main()
int result = (-1);
While (Low <= High) And (int result = (-1));
Middle = (Low + High) Div 2;// find middle of list
If ElementSought = Vector[Middle] THEN;
int result = Middle // Found
ELSE
IF ElementSought < Vector [Middle] THEN;
High = Middle - 1; // search lower half
IF ElementSought > Vector[Middle] THEN;
Low = Middle + 1; //search upper half
ENDIF
ENDWHILE;
}