查找
摘要:顺序查找 顺序查找是指将序列从头开始遍历,直到找到指定的元素为止。 在一个元素为n的序列中查找不存在的元素,需要比较n次。顺序查找虽然效率低下,但是却适用于任何序列。 顺序查找的代码如下: 1 public static int seqSearch(int[] arr, int val) { 2 f
阅读全文
posted @ 2019-09-26 21:46
posted @ 2019-09-26 21:46
posted @ 2019-09-22 13:09
posted @ 2019-09-19 11:19
posted @ 2019-08-04 22:06