Skip to content

Glossary: Data Structures and Algorithms in JavaScript

Sift up, sift down

Also written: sifts it up, sifts it down

The heap steps that restore order. Push adds an item at the end and swaps it up past larger parents; pop moves the last item to the root and swaps it down past smaller children.

Where the book teaches it

Related terms

Heap