Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "linked_list.cpp"
- #include "ilist.cpp"
- using namespace std;
- int main() {
- // inicjalizacja
- ilist<long> *lista = new list<long>();
- cout << "declaration done ..." << endl;
- lista->print();
- // dodanie elementow
- cout << "pushing three elements back ..." << endl;
- for (int i=0; i<3; i++) {
- lista->push_back(i);
- lista->print();
- }
- cout << "pushing three elements front ..." << endl;
- for (int i=-1; -3<=i; i--) {
- lista->push_front(i);
- lista->print();
- }
- cout << "pushing element 123 at index 0 ..." << endl;
- lista->insert(123, 0);
- lista->print();
- cout << "pushing element 234 at index 1 ..." << endl;
- lista->insert(234, 1);
- lista->print();
- cout << "pushing element 777 at index 6 ..." << endl;
- lista->insert(777, 6);
- lista->print();
- cout << "removing two element from back ..." << endl;
- lista->remove_back();
- lista->print();
- lista->remove_back();
- lista->print();
- cout << "removing two element from front ..." << endl;
- lista->remove_front();
- lista->print();
- lista->remove_front();
- lista->print();
- // wypisanie
- cout << "printing one last time ..." << endl;
- lista->print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement