有序表查找优化算法

#include <stdio.h>
#include <stdlib.h>

int Swquential_Search(int *a, int n, int key)
{
	int i;
	a[0] = key;
	i = n;

	while(a[i] != key)
	{
		i--;
	}

	return i;
}


posted @ 2013-04-27 19:46  javawebsoa  Views(114)  Comments(0)    收藏  举报