查找概念:指在某种数据结构中找出满足给定条件的元素。分为内查找和外查找。若查找过程都在内存中进行,被称为内查找;若查找过程中需要访问外存,则称为外查找。
线性表的查找
1)顺序查找,直接for循环遍历。
2)二分查找
public class Search {
public static void main(String[] args) {
int[] a={
1,2,3,4,5,6,7,8,9};
int x=6;
System.