Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "When is insertion into a linked list genuinely constant-time?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/checkpoint-1/checkpoint-1-linked-insert/).
Context (verbatim from the page):
"""
When is insertion into a linked list genuinely constant-time?
When the caller already holds the node or link at the insertion position.
Whenever the list is singly linked, regardless of how the position is found.
Only after copying the list into an array.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in CS foundations. Where you are unsure, say so.