Work on adding example for basic datastructs
This commit is contained in:
42
plates/cpp-datastruct/apps/driver.cpp
Normal file
42
plates/cpp-datastruct/apps/driver.cpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#include <lib-datastruct.h>
|
||||
#include <iostream>
|
||||
|
||||
enum OPS {
|
||||
EXIT, LISTS, STACKS, QUEUES
|
||||
};
|
||||
|
||||
int main ()
|
||||
{
|
||||
// std::cout << "Running driver program version " << DS_VERSION;
|
||||
|
||||
bool exit = false;
|
||||
LinkedList<int> t;
|
||||
int choice;
|
||||
while (!exit) {
|
||||
std::cout << "Enter a choice below...\n\t0. Exit"
|
||||
<< "\n\t1. LISTS\n\t2. STACKS\n\t3. QUEUES\n";
|
||||
std::cin >> choice;
|
||||
std::cin.clear();
|
||||
|
||||
switch (choice) {
|
||||
case EXIT: // 0
|
||||
exit = true;
|
||||
break;
|
||||
|
||||
case LISTS: // 1
|
||||
break;
|
||||
|
||||
case STACKS: // 2
|
||||
break;
|
||||
|
||||
case QUEUES: // 3
|
||||
break;
|
||||
|
||||
default:
|
||||
std::cout << "Invalid option selected\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user