New Project migration

This commit is contained in:
2026-02-27 12:58:49 -05:00
parent 37af3d5ed4
commit 64c10c8678
2 changed files with 111 additions and 0 deletions

60
main.cpp Normal file
View File

@@ -0,0 +1,60 @@
// Linked List Cycle.cpp :
#include "d_linked_list.h"
#include <iostream>
using namespace std;
int main() {
d_linked_list list = d_linked_list();
string input;
while (true) {
cout
<<"Instructions: " << endl
<< "pop" << endl
<< "push" << endl
<< "delete" << endl
<< "insert" << endl
<< "generate" << endl
<< "sort" << endl
<< "print" << endl
<< "erase" << endl
<< "quit" << endl
<< ": ";
cin >> input;
cout << endl;
if (input == "pop") {
list.pop();
}
else if (input == "push") {
cout << "Input: ";
int target;
cin >> target;
list.push(target);
}
else if (input == "delete") {
int target;
cout << "Enter element: ";
cin >> target;
list.del_element(target);
}
else if (input == "quit") {
return 0;
}
else if (input == "print") {
list.print_data();
}
else if (input == "erase") {
list.del_all_data();
input = "";
}
else if (input == "generate") {
int num_items;
cout << "Enter number of items: ";
cin >> num_items;
list.gen_list(num_items);
}
}
}