(
inti = 0; i < size; ++i) {
23 if(array[i] == key) {
39 int*array =
new int[size];
40 for(
inti = 0; i < size; i++) {
51array =
new int[size];
52 for(
inti = 0; i < size; i++) {
60std::cout <<
"All tests have successfully passed!\n";
71std::cout <<
"Choose mode\n";
72std::cout <<
"Self-test mode (1), interactive mode (2): ";
78std::cout <<
"\nEnter the size of the array [in range 1-30 ]: ";
81 while(size <= 0 || size > 30) {
82std::cout <<
"Size can only be 1-30. Please choose another value: ";
86 int*array =
new int[size];
90std::cout <<
"Enter the array of "<< size <<
" numbers: ";
91 for(
inti = 0; i < size; i++) {
95std::cout <<
"\nEnter the number to be searched: ";
100std::cout <<
"Number found at index: "<< index <<
"\n";
102std::cout <<
"Array element not found";
static void tests()
Self-test implementations.
int LinearSearch(int *array, int size, int key)
for IO operations
int main()
Main function.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4