Write the algorithm to delete the first node of a singly linked list.
Linked Lists
Original Khojo Papers practice question — not from a past board paper.
A node of a singly linked list holds one reference, to the next node, so the list can be traversed in one direction only. A node of a doubly linked list holds two references, to the next and the previous node, so it can be traversed both ways and a node can be deleted knowing only that node.
No citable source has been recorded for this record. Treat it as practice material, not as fact.
The doubly linked list costs one extra reference per node.
From the same topic and chapter, at a similar level.
Write the algorithm to delete the first node of a singly linked list.
Linked Lists
Write the Java class definition of a node of a singly linked list holding an integer.
Linked Lists
What is a linked list? State two advantages it has over an array.
Linked Lists
Write the algorithm to insert a node at the beginning of a singly linked list.
Linked Lists
State and verify the absorption law X + X·Y = X using a truth table.
Boolean Algebra
Write a recursive Java method to compute the factorial of a non-negative integer n.
Recursion