Consider a singly linked list having n nodes. The data items d₁,d₂,...,dₙ are…

PYQ GATE 1993

Consider a singly linked list having n nodes. The data items d₁,d₂,...,dₙ are stored in these n nodes. Let X be a pointer to the j-th node (1≤j≤n) in which dⱼ is stored. A new data item d stored in node with address Y is to be inserted. Give an algorithm to insert d into the list to obtain a list having items d₁,d₂,...,dⱼ₋₁,d,dⱼ,...,dₙ in the order without using the header.

Attempted by 2 students.

Sign up free to check your answer

Sign up free

Explore the full course: Data Structures

Loading lesson…