
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@manubb/union-find
Advanced tools
A JS implementation of disjoint-set data structure for node and browsers.
The library is available as a npm package:
npm install @manubb/union-find
Examples directory contains implementations of:
Examples can be run with:
npm run example:components
npm run example:hk
npm run example:kruskal
The library uses trees to encode sets. It exposes three functions.
makeSet();
returns an object representing a set containing one element. It has two properties: parent
and rank
. You can then safely add other properties that suit to your needs.
Note that you can also use your own custom function that should return an object obj
with:
obj.rank === 0
obj.parent === obj
At any time, you can check if obj
is the root of a tree with:
obj.parent === obj
find(obj)
returns the root of the tree that contains obj
. Checking if two objects belong to the same set can be done with:
find(obj1) === find(obj2)
union(obj1, obj2)
merges the sets containing obj1
and obj2
and returns undefined
.
makeSet
run in constant time. If n
is the total number of elements, find
and union
run in amortized time O(α(n))
where α is the inverse Ackermann function. It is a very slowly increasing function: α(10^35164)=5
. For all practical purposes, one can consider that find
and union
run in constant amortized time.
import { makeSet, find, union } from '@manubb/union-find';
or
const { makeSet, find, union } = require('@manubb/union-find');
FAQs
a disjoint-set data structure
The npm package @manubb/union-find receives a total of 6 weekly downloads. As such, @manubb/union-find popularity was classified as not popular.
We found that @manubb/union-find demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.