1. Set ptr=Start
2. Repeat step-3 while ptr!=null
3. If ptr==A then
Set n-->Next=ptr-->Next (or=B)
Set ptr-->Next=N
Exit
Else
Set ptr=ptr-->Next
4. If ptr==Null insertion successful
5. Stop.
Let Start be a pointer to a linked list in memory with successive nodes A & B. following algorithm describes how to insert node N between nodes A and B.
2. Repeat step-3 while ptr!=null
3. If ptr==A then
Set n-->Next=ptr-->Next (or=B)
Set ptr-->Next=N
Exit
Else
Set ptr=ptr-->Next
4. If ptr==Null insertion successful
5. Stop.
Let Start be a pointer to a linked list in memory with successive nodes A & B. following algorithm describes how to insert node N between nodes A and B.
any java executable program for this
ReplyDelete