Пример #1
0
void testSLL(){
    SortedLinkedList * a = new SortedLinkedList();
    a->insert("zxc");
    a->insert("cat");
    a->insert("dog");
    a->insert("sup");
    a->insert("mom");
    a->insert("apple");
    a->insert("moma");
    a->insert("zz");
    a->print();
    cout << endl << endl << "REMOVED AFTER THIS :" << endl << endl;
    a->remove("zxc");
    a->remove("apple");
    a->remove("sup");
    a->remove("zz");
    a->print();
}
Пример #2
0
void removeAllWords(SortedLinkedList &A, char *file)	//O(n^2)
{
    ifstream in;
    in.open(file);
    Timer t;
    string word;
    double etime;
    t.start();
    while(in>>word)
    {
        A.remove(word);
    }
    t.elapsedUserTime(etime);
    cout<<etime<<endl;

}