← Search

Micro-Drill #72 — Heap as priority queue

Search Target: 10s

Priority queues power Dijkstra's algorithm and task scheduling problems.

import heapq
heapq.heappush(h, (priority, item))
_, item = heapq.heappop(h)

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #71 Micro #73 →