Programming Fundamentals Quiz No 01

Here is the Programming Fundamentals Quiz No 01

Question :

Delete a node from link list using recursion.

Code:

Here is the Programming Fundamentals Quiz No 01

void deleteNode(Node *node, int key) {
if (node == NULL) return;
if (node->data == key) {
Node *temp = node->next;
node->data = temp->data;
node->next = temp->next;
delete temp;
} else {
deleteNode(node->next, key);
}
}

For more details about Huffman coding click here

For other assignments and quizzes click here 

Output:

Leave a Reply

Your email address will not be published. Required fields are marked *