An open API service indexing awesome lists of open source software.

https://github.com/ivanbgd/disjoint-sets-data-structure

Efficient implementation of the Disjoint Sets data structure in Python
https://github.com/ivanbgd/disjoint-sets-data-structure

disjoint-set disjoint-sets

Last synced: 6 months ago
JSON representation

Efficient implementation of the Disjoint Sets data structure in Python

Awesome Lists containing this project

README

          

# Disjoint Sets Data Structure

This is an efficient implementation of the Disjoint Sets data structure, written in Python.

Uses Trees, Union by Rank Heuristic, and Path Compression Heuristic.

Uses 1-based indexing of arrays.

When both union by rank heuristic and path compression heuristic are used, the average running time of each operation is nearly constant.

The code includes examples.