Write an algorithm to “Delete At Starting Point” using Doubly link list

Algorithm:

Delete (node head)
1. [Start]
2. [Check for empty]
If head=null then
Show “List is empty”
Else if head->next=null then
Node temp=head
Delete temp
Head=null
Else
Node temp=head
Head=temp->next
Head->pre=null
Delete temp
[End of if else step (2)]
3. [Return]

Leave a Reply

Your email address will not be published. Required fields are marked *