java数据结构和算法------顺序查找

 1 package iYou.neugle.search;
 2 
 3 public class Sequence_search {
 4     public static int SequenceSearch(double[] array, double key) {
 5         for (int i = 0; i < array.length; i++) {
 6             if (key == array[i]) {
 7                 return i;
 8             }
 9         }
10         return -1;
11     }
12 }

 

posted @ 2015-07-06 17:06  iYou  阅读(194)  评论(0编辑  收藏  举报