Friday, 25 January 2013

Algorithm for Delete a node at the End of a Linked List

ALGORITHM NAME: DELETE_BEGIN_LL(&START)


1.start
2.temp=&start 
3.prev=&start
4.If start=NULL
                1.Print Linkedlist is Empty
5.Else
                1.while temp->link!=NULL,do
                                1.prev=temp
                                2.temp=temp->link
                2.End while
                3.If temp=prev
                                1.start=NULL
                4.else
                                1.prev->link=NULL
                                2.Delete node pointed by temp
                5.End if
6.End if
7.stop


No comments:

Post a Comment