Binary Tree Types

1. Full (Proper) Binary Tree # Each nodes has either 2 or 0 children. 12 8 18 5 11 2. Degenerate (Pathological) Binary Tree # Each internal node has either a right or a left child. # Each node is a left node or each node is a right node. 1 1 2 2 3 3 4. Complete Binary Tree # Each level is filled from left to right. 8 5 3 4 6 7 5....

December 10, 2022 · 2 min · 218 words · Me

Union Find

Introduction The Union Find data structure stores a collections of disjoint (non-overlapping) sets and can be used to model connected components in undirected graphs. This data structure can be used to: determine if two vetices belong to the same component detect cycles in a graph find the minimum spanning tree of a graph Union Find Implementation Optimized Union Find (Disjoint Set) python implementation with path compression and union by rank....

December 7, 2022 · 2 min · 232 words · Me