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
- Host: GitHub
- URL: https://github.com/ivanbgd/disjoint-sets-data-structure
- Owner: ivanbgd
- License: mit
- Created: 2017-11-10T17:04:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-10T17:11:46.000Z (almost 8 years ago)
- Last Synced: 2025-02-03T10:11:58.588Z (8 months ago)
- Topics: disjoint-set, disjoint-sets
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.