Data Structures -- Linked List Find the nth last element in linked list. in Programming Posted November 23, 2007 · Report reply while(ptr->next->next->next->next->next!=NULL) ptr=ptr->next; //after loop, ptr points to the fifth last element in the list;
Data Structures -- Linked List Find the nth last element in linked list.
in Programming
Posted · Report reply
while(ptr->next->next->next->next->next!=NULL) ptr=ptr->next; //after loop, ptr points to the fifth last element in the list;