码迷,mamicode.com
首页 > 其他好文 > 详细

顺序查找

时间:2017-06-02 17:48:33      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:log   ==   i++   key   ++   stat   bsp   pre   length   

 1 public class Solution {
 2 
 3     public static int SequenceSearch(int[] sz, int key) {
 4         for (int i = 0; i < sz.length; i++) {
 5             if (sz[i] == key) {
 6                 return i;
 7             }
 8         }
 9         return -1;
10     }
11 }

 

顺序查找

标签:log   ==   i++   key   ++   stat   bsp   pre   length   

原文地址:http://www.cnblogs.com/yl-saber/p/6933754.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!