2 - Linked List Implementation I - 2101637541 - Vick Koesoemo Santoso
2 - Linked List Implementation I - 2101637541 - Vick Koesoemo Santoso Single Linked List Single linked list adalah sekumpulan node yang terhubung ke node lain melalui pointer. Single linked list Insert (PushHead) = jika kita ingin memasukkan node baru dari depan struct tnode *node = (struct tnode*) malloc(sizeof(struct tnode)); node->value = x; node->next = head; head = node; Single linked list delete // if x is in head node if ( head->value == x ) { head = head->next; free(curr); } // if x is in tail node else if(tail->value == x){ while(curr->next!=tail) curr = curr->next; free(tail); tail = curr; tail->next = NULL; } ...