Back to problems

Indexed Linked List with Checkpoints

Object-Oriented Programming · OpenAI · Medium

Build a simplified container that keeps strings in order. From the outside it should feel like a dynamic array addressed by integer positions, but internally every element has to live in a singly linked list. A positive integer k, the checkpoint interval, is fixed when the container is created. Alongside the head of the list, the container keeps a set of checkpoints: when the sequence currently holds n elements, there is a stored pointer to the node at each logical position…

Loading the rest of the question…