31 lines
729 B
C++

#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;
}