Binary search on List<Tuple<int,int>> in c#

Viewed 1108

I use C# language and I have a little question about List<Tuple<int,int>>. Assume that I created a List<Tuple<int,int>> and then inserted some entry to it like: (12,3),(154,43),(85,342)

Now I want to search the List JUST by first item, i.e. just by item1 and I want to do this by binary search.

something like this:

List<Tuple<int,int>> tt = new List<Tuple<int,int>>();
tt.Add(new Tuple<int,int>(12,32));
tt.sort();
tt.binarysearch(item1:12);

and some output like this:

12 32

Now is there any solution?

1 Answers
Related