Write an algorithm to implement a queue using linked list
Answers
Answered by
2
Answer:
please mark me as brainliest
Answered by
2
Step 1: Allocate the space for the new node PTR.
Step 2: SET PTR -> DATA = VAL.
Step 3: IF FRONT = NULL. SET FRONT = REAR = PTR. SET FRONT -> NEXT = REAR -> NEXT = NULL. ELSE. SET REAR -> NEXT = PTR. SET REAR = PTR. SET REAR -> NEXT = NULL. [END OF IF]
Step 4: END.
Similar questions