/* * polylisttest.cpp * * Created on: 23.11.2012 * Author: trifon */ #include "polylist.cpp" void createStackQueueList() { PolyList l; for(int i = 1; i <= 5; i++) { IntStack* s = new IntStack; for(int j = i; j <= i*i; j++) s->push(j); l.toEnd(s); IntQueue* q = new IntQueue; for(int j = i+5; j <= i*i+2; j++) q->push(j); l.toEnd(q); } for(PolyList::I it = l.iteratorBegin(); it; ++it) (*it)->print(); } void createSList() { PolyList l; l.toEnd(new Integer(1)); PolyList* l2 = new PolyList; l2->toEnd(new Integer(2)); PolyList* l3 = new PolyList; l3->toEnd(new Integer(3)); l2->toEnd(l3); l.toEnd(l2); PolyList* l4 = new PolyList; l4->toEnd(new Integer(4)); PolyList* l5 = new PolyList; PolyList* l6 = new PolyList; l6->toEnd(new Integer(5)); l5->toEnd(l6); l4->toEnd(l5); l.toEnd(l4); l.print(); } int main() { // createStackQueueList(); createSList(); return 0; }