Step 2 of 6
Arrays, linked lists, stacks and queues
An array is a row of numbered boxes: instant to read by position, slow to insert in the middle. A linked list is a chain where each item points to the next. A stack is last-in-first-out (undo history). A queue is first-in-first-out (a job queue, a waiting line).
Why it matters when you build with AI: Background jobs, emails to send, retry logic and undo buttons are all stacks and queues in disguise.
Quick check
An undo button is best modelled as a…
Undo removes the most recent action first: last in, first out.