Lesson 7: Stacks and Queues

Stack is a container of objects that are inserted and removed according to the last-in-first-out (LIFO) principle. Queue is a container of objects (a linear collection) that are inserted and removed according to the first-in-first-out (FIFO) principle.

Open reading material (PDF)

Brackets

Determine whether a given string of parentheses (multiple types) is properly nested.

Difficulty Level: Easy

Fish

N voracious fish are moving along a river. Calculate how many fish are alive.

Difficulty Level: Easy

Nesting

Determine whether a given string of parentheses (single type) is properly nested.

Difficulty Level: Easy

StoneWall

Cover "Manhattan skyline" using the minimum number of rectangles.

Difficulty Level: Easy