A print scheduler stores jobs in the singly linked list shown. Each arrow between nodes represents a next reference, and None marks the end. Which single Python assignment removes the first job from the list while keeping every other job in its original order?


The head reference points to node A, followed by nodes B and C and then None.


Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

A singly linked list is built from nodes that each hold a value and one link to another node. Match each term on the left with the description of the role it plays in the list.

Match each term
A.

The empty value stored in the final node's link field to mark the end of the chain

B.

An optional extra variable pointing at the final node, so adding at the end needs no walk from the front

C.

Following links one node at a time from the front, since there is no index arithmetic to jump ahead

D.

The part of each node that stores the address of its successor

E.

A placeholder that sits before the first real element so front insertions and removals need no special case

F.

The variable holding the address of the first node; if it is overwritten carelessly, every node becomes unreachable

Head reference

Null link

Tail reference

Traversal

Sentinel node

Next field

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

An attendance system stores identifiers in the singly linked list shown, with pred referring to node B. Insert identifier 55 immediately after B, preserving every original node and its relative order. The variable x does not yet exist. Arrange the three Python statements in their correct execution order; Node(55) creates a new node storing 55.


Nodes A, B and C store 21, 34 and 89, with pred referring to node B.


Loading ordering steps…

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice