(a) Let p be a pointer as shown in the figure in a single linked list. What do…

PYQ GATE 1998

(a) Let p be a pointer as shown in the figure in a single linked list.

Singly linked list with p at cell i, followed in order by cell i+1, cell i+2 and cell i+3; arrows connect successive cells.

What do the following assignment statements achieve?

q := p→next
p→next := q→next
p→next := (q→next)→next
(p→next)→next := q

(b) Compute the post fix equivalent of the following expression.

3 * log(x + 1) − a/2

Attempted by 2 students.

Sign up free to check your answer

Sign up free

Explore the full course: Zero To Hero

Loading lesson…