How would you implement a priority queue for task scheduling in an environment with limited memory at Motorola Solutions?