Brainlag
  1. C
  2. Advanced
27/38 lessons

Stacks and queues

55 min5 exercisesPremium

Build a stack and a ring buffer queue in C from an array and a couple of indexes, handle full and empty, and use a stack to check brackets.

The skill
Build a stack and a ring buffer queue from an array and a few indexes, and refuse to overfill or overdraw them.
You make
A bounded stack, a bracket checker, a song request queue and a browser's back and forward buttons.

Premium lesson

£7.99 a month or £59 a year. Cancel any time.

Builds on 26 Linked lists. Free to try: C Foundations and the playground.

Step 1 of 9
exercise_1.c

You've reached the good stuff.

5 exercises in this lesson, checked as you type. Premium opens every lesson after Foundations, in all four courses.

C, 32-bit: int and pointers are 4 bytes