Implementing priority queues with a heap

Introduction

Priority queues

Each item has associated priority. want to be able to take highest priority, add others Can be implemented using a heap; or a self balanacing binary tree Operations: insert with priority; pull highest priorty; is emtpy?

Heaps

Parent greater than or equal to children

Root then always has highest number

Binary heap: just 2 children per node