1: void delete_node(list_t *node)
2: {
3: list_t *temp = node;
4: if (NULL == temp->next)
5: {
6: // Last node
7: free(temp);
8: return;
9: }
10: // Any node other than last
11: temp = temp->next;
12: node->data = temp->data;
13: node->next = temp->next;
14: free(temp);
15: return;
16: }
RTOS, Linux Kernel internal, OS-Programming C & Data Structures, Debugging, Optimizations, Makefiles and Wireless Technologies (Wi-Fi ,LTE and LTE-Advanced )
Search This Blog
Sunday, September 21, 2014
WAP to delete a node of singly linked list if only address on that node is given
Labels:
C,
Data Structure
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment