#ifndef CA_UWATERLOO_ALUMNI_DWHARDER_SEARCHING_ALGORITHMS_LINEAR_SEARCH_BASIC #define CA_UWATERLOO_ALUMNI_DWHARDER_SEARCHING_ALGORITHMS_LINEAR_SEARCH_BASIC namespace Searching_algorithms { namespace Linear_search { class Basic { public: template static bool search( Type const &obj, Type *const array, int const n ) { for ( int i = 0; i < n && array[i] <= obj; ++i ) { if ( array[i] == obj ) { return true; } } return false; } }; } } #endif