Esempio n. 1
0
int main(){
	int list_array[] = {2, 3, 4, 5, 8, 1, 9};
	
	struct node* list_head = BuildWithLocalRef(list_array, sizeof(list_array)/sizeof(list_array[0]));
	DeleteListV1(&list_head);
 
	return 0;
}
Esempio n. 2
0
int main(int argc, const char * argv[])
{

    //printList(appendNode(&(BuildWithLocalRef()), 2)); //doesn't work? &(2376ut) doesn't work not a lvalue
    Node* head=BuildOneTwoThree();
    appendNodeWithPush(&head, 4);
    appendNode(&head, 4);
    appendNode(&head, 4);
    Node* test5=BuildWithLocalRef();
    Push(&test5, 6);
    insertNth(&test5, 4, 3);
    //printList(test5);
    insertSort(&test5);
    append(&test5, &head);
    //printList(test5);
    Node *first=NULL,*second=NULL;
    //pop(&test5);
    //split(test5, &first, &second);
    //printList(first);
    //printList(second);
    //removeDuplicates(second);
    //printList(first);
    //printList(second);
    //moveNode(&first, &second);
    //printList(first);
    //printList(second);
    alternatingSplit(test5, &first, &second);
    //printList(first);
    //printList(second);
    //Node* test=shuffleMergeRecursive(first, second);
    //printList(test);
    Node* test1=BuildOneTwoThree();
    Node* test2=BuildOneTwoThree();
    pop(&test2);
    appendNode(&test2, 7);;
    appendNode(&test1, 5);
    //printList(test1);
    //printList(test2);
    append(&test1, &test2);
    //printList(test1);
    mergeSort(&test1);
    //printList(test1);
    Node* t4=BuildOneTwoThree();
    Node* t5=BuildOneTwoThree();
    appendNode(&t5, 6);
    appendNode(&t4, 6);
    appendNode(&t4, 7);
    appendNode(&t5, 8);
    Push(&t5, 0);
    Push(&(t5->next), 1);
    //printList(t5);
    //printList(t4);

    //printList(sortedIntersect(t4, t5));
    recursiveReverse(&t5);
    printList(t5);
    return 0;
}