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 singly linked list truly O(1)?" on CodeWiki (https://codewiki.com/practice/mcq/foundations/arrays-and-linked-lists/known-node-insertion/).
Context (verbatim from the page):
"""
When is insertion into a singly linked list truly O(1)?
Whenever the list is unsorted
When the insertion index is near the middle
When the required predecessor node is already known
When the inserted value is small
"""
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.