Index Ai Academy
Glossary · Phase 7 · Software engineering

Priority queue

Also written: priority queues

A collection that always hands back its smallest (or most urgent) item next; Python's heapq module provides one.

Try it now

Each pop takes the cheapest place in the queue; its distance never changes after that.

Learn it properly

Searching for solutions · Backtracking with pruning, Dijkstra's algorithm and A*, ending with an optimal sliding-puzzle solver. About 45 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write