On this page
  1. Trees, Heaps & Graphs
  2. Contents
  3. Trees, Balanced BSTs & B-Trees
  4. Binary Heaps (Priority Queues)
  5. Graphs, BFS, DFS & Shortest Paths

Trees, Heaps & Graphs

Prev: Linear & Hashed Structures | Up: algorithms_and_dsa | Next: Problem-Solving Patterns
Rel: Database B-Tree & LSM Indexing
Ref: Wikipedia — Graph Traversal
Tags: #public #prog #programming #dsa #trees #graphs


Contents


Trees, Balanced BSTs & B-Trees


Binary Heaps (Priority Queues)

A binary heap is a complete binary tree stored compactly in an array (parent = (i - 1) // 2, children = 2i + 1, 2i + 2):


Graphs, BFS, DFS & Shortest Paths

Represent sparse graphs with an adjacency list (node -> [neighbors]) and dense graphs with an adjacency matrix.

Linked from

Related notes