Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 240 Bytes

顺序查找.md

File metadata and controls

19 lines (15 loc) · 240 Bytes

#顺序查找

基本原理:依次遍历

public class Solution {

	public static int SequenceSearch(int[] sz, int key) {
		for (int i = 0; i < sz.length; i++) {
			if (sz[i] == key) {
				return i;
			}
		}
		return -1;
	}
}