Heap
A heap is a specialized tree-based data structure that satisfies the heap property: in a min-heap, every parent node is less than or equal to its children; in a max-heap, every parent is greater than or equal to its children. Heaps are typically implemented as arrays representing a complete binary tree, and they…
15 resources across 3 libraries
Glossary Terms(5)
Tree
A tree is a hierarchical, non-linear data structure consisting of nodes connected by edges, with one node designated as the root and every other node having ex…
Graph
A graph is a data structure consisting of a set of nodes (vertices) connected by edges, which may be directed or undirected and weighted or unweighted, used to…
Heap
A heap is a specialized tree-based data structure that satisfies the heap property: in a min-heap, every parent node is less than or equal to its children; in…
Queue
A queue is a linear data structure that follows First-In-First-Out (FIFO) ordering: elements are added at the rear (enqueue) and removed from the front (dequeu…
Stack
A stack is a linear data structure that follows Last-In-First-Out (LIFO) ordering: elements are added and removed from the same end, called the top, so the mos…
Study Notes(3)
Span<T> and Memory<T>
How Span<T> and Memory<T> let .NET code work with contiguous memory safely and with minimal or zero allocations, and when to use each.
The Heap and Dynamic Memory
How assembly programs request and manage runtime memory using brk/sbrk and mmap, and the manual bookkeeping needed to avoid leaks.
Heap Sort and Counting Sort
How heap sort uses a binary heap for guaranteed O(n log n) in-place sorting, and how counting sort achieves linear time for bounded integers.
Interview Questions(7)
What is a Heap?
A heap is a complete binary tree stored in an array that satisfies the heap property — in a min-heap every parent is smaller than or equal to its children, giv…
What is a Priority Queue?
A priority queue is an abstract data type where each element has a priority, and the element with the highest (or lowest) priority is always removed first, typ…
What is Dijkstra’s Algorithm?
Dijkstra’s algorithm finds the shortest path from a single source vertex to every other vertex in a weighted graph with non-negative edge weights, using a gree…
What is a Min-Heap?
A min-heap is a complete binary tree, usually stored as an array, where every parent node is less than or equal to its children, guaranteeing the smallest elem…
What is a Max-Heap?
A max-heap is a complete binary tree, usually stored as an array, where every parent node is greater than or equal to its children, guaranteeing the largest el…
What is a Treap and How Does It Balance Itself?
A treap is a randomized binary search tree that combines BST ordering on keys with heap ordering on randomly assigned priorities, and the randomness alone keep…
What is a Cartesian Tree and What Is It Used For?
A Cartesian tree is a binary tree built from a sequence of values where an in-order traversal recovers the original sequence order, and simultaneously the tree…