Linear structures quick cards
Recall the retrieval and update rules for common linear data structures.
Recall LIFO What does LIFO mean for a stack? Think undo history. FIFO What does FIFO mean for a queue? Think ticket line. Trade-off Array versus linked list Choose by how the program finds the item. Objection Why not just use an array for the queue? The code removes from the head frequently. Readable array code may hide expensive head removal. Your line If this is FIFO and the queue can grow large, let's use a queue/deque implementation that does not shift the whole sequence on each dequeue. It preserves the semantics while focusing on operation cost. When does a…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in