← Search

Micro-Drill #70 — Heapify a list

Search Target: 5s

heapify converts a list to a heap in O(n). Faster than n individual pushes.

import heapq
heapq.heapify(a)

Type it from memory. Go.

Practice Problems

Related Coding Drills

← Micro #69 Micro #71 →