1

update list demos

This commit is contained in:
2022-07-19 00:19:08 +02:00
parent 99f60383ee
commit f040aa562b
3 changed files with 11 additions and 11 deletions

View File

@ -57,17 +57,17 @@ void MainMenu::run() {
choosen_demo = new PreemptiveThreadDemo(3); choosen_demo = new PreemptiveThreadDemo(3);
break; break;
// Temporary extra demos for testing case 'q':
case '0':
choosen_demo = new ArrayListDemo(); choosen_demo = new ArrayListDemo();
break; break;
// case '0': case 'w':
// choosen_demo = new LinkedListDemo(); // NOTE: The LinkedListDemo will take considerably longer for the threadswitching part
// break; // because for every insertion/deletion memory will be allocated for the wrappers
// case '0': choosen_demo = new LinkedListDemo();
// choosen_demo = new ArrayDemo(); break;
// break; case 'e':
choosen_demo = new ArrayDemo();
break;
} }
if (choosen_demo != NULL) { if (choosen_demo != NULL) {

View File

@ -68,7 +68,7 @@ void ArrayListDemo::run() {
this->list.print(kout); this->list.print(kout);
kout << "Starting..." << endl; kout << "Starting..." << endl;
for (unsigned int n = 0; n < 1000; ++n) { for (unsigned int n = 0; n < 10000; ++n) {
this->list.insert_last(active); this->list.insert_last(active);
active = list.remove_first(); active = list.remove_first();

View File

@ -68,7 +68,7 @@ void LinkedListDemo::run() {
this->list.print(kout); this->list.print(kout);
kout << "Starting..." << endl; kout << "Starting..." << endl;
for (unsigned int n = 0; n < 1000; ++n) { for (unsigned int n = 0; n < 10000; ++n) {
this->list.insert_last(active); this->list.insert_last(active);
active = list.remove_first(); active = list.remove_first();