示例#1
0
int main()
{
    StringLinkedList<int> A;
    A.addFront(10);
    A.addFront(15);
    A.addAfter(12,10);
    A.addFront(13);
    cout<<"Front : "<<A.front()<<endl;
    A.printList();
    cout<<"After sorting : ";
    A.sortList();
    A.printList();
    cout<<"After reversing : ";
    A.reverseList();
    A.printList();
    A.removeFront();
    A.removeFront();
    A.printList();
    return 0;
}
示例#2
0
void LinkedStack::push(const int& element) {
    S.addFront(element);
    n++;
}