Accounting for both links and padding

A document application stores 1,250 records in a doubly linked list. Each node stores 18 bytes of record data, an 8-byte next reference, and an 8-byte prev reference. Null references still occupy their full 8-byte fields.


Each node's allocated size is rounded up to the smallest multiple of 8 bytes that can hold these fields. The extra unused bytes are padding. Assume all padding occurs after the fields, and there is no other per-node allocation overhead.


The list also has one separate header containing an 8-byte head reference, an 8-byte tail reference, and an 8-byte length field. The header needs no additional padding, and there is no other storage to count.


Find the allocated size of one node, the total storage for the nodes and header together, and the total padding across all nodes. Enter each answer as an exact integer in bytes.

Your answers

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

More Doubly Linked Lists Questions: