Wednesday, 23 January 2013

Algorithm for Insert a node at the Beginning of a Linked List

algorithm name: insert_begin_ll(&start,d)

1.start
2.Create a node and store its starting address to temp
3.If temp=NULL
                1.print Insertion is not possible
                2.Exit
4.End if
5.temp->data=d
6.temp->link=NULL
7.temp->link=start
8.start=temp

9.stop

No comments:

Post a Comment