Problem Solving with Go course

Stacks, Queues and SearchQuiz: Stacks, Queues and Search

Problem Solving with Go

Display

Theme

Stacks, Queues and Search · Quiz

Quiz: Stacks, Queues and Search

Check what you know about stacks, queues, BFS, flood fill and tracing a path back. Answer every question below.

  1. Question 1 of 6The values 1, 2 and 3 are pushed onto a stack in that order, then two values are popped. What is left?
  2. Question 2 of 6queue is a []int used as a queue. Which lines take the front value off?
  3. Question 3 of 6A ring buffer has a capacity of 5, head = 3 and size = 4. At which index does the next Push write?
  4. Question 4 of 6Why does BFS find the shortest path when every step costs the same?
  5. Question 5 of 6In BFS, when should a cell be marked as seen?
  6. Question 6 of 6A flood fill paints a region with the same colour it already has, and it uses the painted colour to tell which cells are done. What happens?