consolidate all repos to one for archive
This commit is contained in:
31
semester_2/programiranje_2/naloga0802/main.cpp
Normal file
31
semester_2/programiranje_2/naloga0802/main.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
#include "LinkedList.h"
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello, World!" << std::endl;
|
||||
|
||||
LinkedList<int> list;
|
||||
|
||||
std::cout << "List " << (list.isEmpty() ? "IS" : "IS NOT") << " empty." << std::endl << std::endl;
|
||||
|
||||
|
||||
list.add(1);
|
||||
list.add(4);
|
||||
list.add(10);
|
||||
list.insertAt(2,5);
|
||||
|
||||
std::cout << "List " << (list.isEmpty() ? "IS" : "IS NOT") << " empty." << std::endl << std::endl;
|
||||
|
||||
std::cout << "List (size " << list.getSize() << "): " << std::endl;
|
||||
|
||||
for(int i=0; i<list.getSize(); i++)
|
||||
std::cout << list.at(i) << std::endl;
|
||||
|
||||
list.insertAt(3,3);
|
||||
std::cout << "\n";
|
||||
|
||||
for(int i=0; i<list.getSize(); i++)
|
||||
std::cout << list.at(i) << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user