Mahdi Rizk

EECS 281, Data Structures and Algorithms

Zombie Defense Simulation

A round-based simulation where a player with a limited quiver shoots approaching zombies in priority order, with optional verbose, running-median, and statistics output.

WhenWinter 2025
TypeCoursework
CourseEECS 281

What I built

  • Kept every zombie in a std::deque so pointers stay stable, and ordered live zombies in a priority_queue of pointers by ETA (distance / speed), then health, then name.
  • Tracked the running median of zombie lifetimes with a max-heap and min-heap pair rebalanced after each kill, giving O(log n) inserts and O(1) median reads.
  • Parsed a header plus per-round blocks of random and named zombies from stdin, generating random zombies with the course's seeded Mersenne Twister.
  • Produced statistics mode output: zombies still active, first and last N killed, and most and least active N, built by sorting a combined record vector.