Algorithms

Moderators: None (Apply to moderate this forum)
Number of threads: 384
Number of posts: 762

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
linked list Posted by kudakwashe on 14 Mar 2006 at 7:43 AM
hie
how do i insert and delete any node between the first node and last node in the list.
Report
Re: linked list Posted by Dipalee on 21 Mar 2006 at 11:52 PM
If you want to insert "new" node after "current" node, then your logic would be
new->next = current->next
current->next = new

if you want to delete "current" node which comes after "previous", then your logic would be
previous = current
current = previous->next
previous->next = current->next
Dipalee




 

Recent Jobs