// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; namespace E { public class Program { public static void Main(string[] args) { int[] a = { 60, 80, 100, 120, 140 }; int ix1 = Array.BinarySearch(a, 80); Console.WriteLine(a[ix1]); List lst = new List(a); int ix2 = lst.BinarySearch(80); Console.WriteLine(lst[ix2]); } } }