1

update for new list interface

This commit is contained in:
2022-07-17 21:02:33 +02:00
parent d09b862dc3
commit 132eb13431
5 changed files with 33 additions and 33 deletions

View File

@ -7,7 +7,7 @@ void ArrayListDemo::run() {
kout << "Adding elements in order" << endl;
for (unsigned int i = 0; i < 5; ++i) {
this->list.insert(i);
this->list.insert_last(i);
}
this->list.print(kout);
@ -22,7 +22,7 @@ void ArrayListDemo::run() {
kout << "Adding elements in order with realloc" << endl;
for (unsigned int i = 0; i < 10; ++i) {
kout << "Add " << dec << i << endl;
this->list.insert(i);
this->list.insert_last(i);
}
this->list.print(kout);
@ -35,7 +35,7 @@ void ArrayListDemo::run() {
// ============================================================
for (unsigned int i = 0; i < 5; ++i) {
this->list.insert(i);
this->list.insert_last(i);
}
this->list.print(kout);
@ -62,14 +62,14 @@ void ArrayListDemo::run() {
// These are the threads
int active = 0; // Idle thread
this->list.insert(1);
this->list.insert(2);
this->list.insert(3);
this->list.insert_last(1);
this->list.insert_last(2);
this->list.insert_last(3);
this->list.print(kout);
kout << "Starting..." << endl;
for (unsigned int n = 0; n < 10000000; ++n) {
this->list.insert(active);
for (unsigned int n = 0; n < 1000; ++n) {
this->list.insert_last(active);
active = list.remove_first();
if (this->list.size() != 3) {