Exemple #1
0
 public int SearchTestInt(int[] arr, int key)
 {
     return(BinarySearver.Search <int>(arr, key, (x, y) => { if (x > y)
                                                             {
                                                                 return 1;
                                                             }
                                                             if (x == y)
                                                             {
                                                                 return 0;
                                                             }
                                                             else
                                                             {
                                                                 return -1;
                                                             } }));
 }
Exemple #2
0
 public int SearchTestIntExc(int[] arr, int key)
 {
     return(BinarySearver.Search <int>(arr, key, null));
 }
Exemple #3
0
 public int SearchTestString(string[] arr, string key)
 {
     return(BinarySearver.Search <string>(arr, key, (x, y) => { return String.Compare(x, y); }));
 }