A music player stores its playlist as a doubly linked list with no extra boundary nodes. Its only node is X, and both head and tail point to X. Empty endpoint references use null. Which assignments correctly represent the playlist after X is removed?


The head and tail references both point to the single playlist node X.


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 doubly linked list stores a next reference and a prev reference in each node. A task manager initially stores A, B, C, D, E in that order. The first node's prev and the last node's next are null; there are no extra boundary nodes.


First remove A. Then insert a new node N between C and D. Complete the table for the resulting list using node names or the word null.


Five nodes A through E form a doubly linked list with head at A and tail at E.


ReferenceFinal value
head
tail
B.prev
B.next
C.next
N.prev
N.next
D.prev

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 editor stores 137 records in a doubly linked list with head and tail references. Positions are numbered from 0, and a target record initially occupies position 101.


The editor removes the first 12 records and the last 9 records. The target remains, but no reference to it is saved. You may start at either current endpoint and locate the target only by following next or prev links.


A link traversal is one move from a node to its neighbour. Starting at an endpoint costs zero traversals. What is the minimum number of link traversals needed to reach the target? Answer in traversals, as an integer to zero decimal places.

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