Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 12 / linearSearch.cpp
blob: 16e9d1a431408e36f2479fcaa31de39e3ffa820e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>


bool linearSearch(const int* arr, unsigned size, int el)
{
	if (size == 0)
		return false;
	return *arr == el || linearSearch(arr + 1, size - 1, el);
}

int main()
{

}