Пример #1
0
void test2(){
    printf("[%s]--------\n", __PRETTY_FUNCTION__);
    SLL* ssl = new SLL();
    ssl->append(1);
    ssl->append(2);
    ssl->append(3);
    ssl->print();
    printf("---------------------------------\n");
} 
Пример #2
0
void test3(){
    printf("[%s]--------\n", __PRETTY_FUNCTION__);
    SLL* ssl = new SLL();
    Node* n1 = new Node(1);
    Node* n2 = new Node(2);
    Node* n3 = new Node(3);

    ssl->append(n1);
    ssl->append(n2);
    ssl->append(n3);
    ssl->print();
    printf("---------------------------------\n");
    ssl->remove(n1);
    ssl->print();

    printf("---------------------------------\n");
} 
Пример #3
0
void test0() {
    begin();
    SLL<int>* ddl = new SLL<int>();
    ddl->append(new Node<int>(1));
    int count = ddl->count();
    printf("[%d]", count);
    delete ddl;
}
Пример #4
0
void testCloneSLL1(){
    printf("[%s]--------\n", __PRETTY_FUNCTION__);
    SLL* ssl = new SLL();
    Node* n1 = new Node(1);
    Node* n2 = new Node(2);
    Node* n3 = new Node(3);
    ssl->append(n1);
    ssl->append(n2);
    ssl->append(n3);
    ssl->remove(n1);
    ssl->print();
    printf("---------------------------------\n");
    SLL* cll = new SLL();
    cll->head = cloneSLL(ssl->head);
    cll->print();

    printf("---------------------------------\n");
}