TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dynamic Tree Connectivity in Rust

1 pointsby schrodingerzhuover 1 year ago

1 comment

schrodingerzhuover 1 year ago
This crate provides a data structure to handle dynamic tree connectivity. Both incremental and decremental operations are supported with amortized O(log n) time complexity.<p>As the underlying data structure is a Splay tree, this crate works best with the situation where the working set is relatively small.<p>To represent a node in the forest, one can create a handle via [Handle::new]. To connect two nodes, one can use [Handle::connect]. This will return a [Connection], which will keep the two nodes connected until it is dropped.