Answer:PROCEDURE INSERT(T, KEY)
[Where ‘head’ pointer has been caught in pointer ‘T’ & the value in ‘key’]
1. [Checking for insertion at beginning and inserting]
if(key <= 0)
Call GETNODE (I)
DATA (I) <-- ‘xyz’
LINK (I) <-- T
T <-- I
return (T).
2. [Traversing to the destination node]
I <-- T
while (DATA (T) != key)
if (LINK(T) == 0)
return (0)
else
T <-- LINK(T))
3. [Inserting the node in the list]
if (LINK(T) == 0)
GETNODE (P)
LINK (P) <-- 0
LINK (T) <-- P
DATA (P) <-- ‘xyz’
return (I)
else
GETNODE (P)
C <-- LINK (LINK(T))
LINK (P) <-- C
LINK (T) <-- P
DATA (P) <-- ‘xyz’
return (I)
4. [FINISH]
return.