Write an algorithm to delete a data element at the end of a linked list.
Answer»
Step 1: if FIRST = NULL then Print “Linked list is empty” Exit End of if Step 2: if FIRST → LINK= NULL then Return FIRST → data FIRST = NULL Else P2 = FIRST While P2 → LINK not equal to NULL P1 = P2 P2 =P2 → UNK End while STEP 4: Return p2 → data STEP 5: P1 → LINK = NULL STEP 6: EXIT.