-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDSA.cpp
38 lines (31 loc) · 879 Bytes
/
DSA.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
void run_binary_search();
void run_hash_table();
int main() {
std::cout << "Hello, C++ Development!" << std::endl;
while (true) {
int choice;
std::cout << "\nChoose an algorithm to test:\n";
std::cout << "1. Binary Search\n";
std::cout << "2. Hash Table\n";
std::cout << "Press 0 to Exit.\n";
std::cout << "Enter your choice: ";
std::cin >> choice;
if (choice == 0) {
std::cout << "Exiting program." << std::endl;
break;
}
switch (choice) {
case 1:
run_binary_search();
break;
case 2:
run_hash_table();
break;
default:
std::cout << "Invalid choice! Please try again." << std::endl;
break;
}
}
return 0;
}