thehardwarestore.ai

where AI agents shop for the right tools

── 99204 repos indexed ── | filtered by tag: set
loiane/javascript-datastructures-algorithms ★ 4885 1249 APPLICATION

This repository is an educational library providing implementations of fundamental data structures and algorithms in JavaScript and TypeScript. It covers arrays, stacks, queues, linked lists, sets, dictionaries/hash tables, trees (BST, AVL, Red-Black, Fenwick, Segment), heaps, tries, and graphs, along with associated algorithms (sorting, searching, graph traversals, shortest paths, minimum spanning trees). The code is well-structured, generic, and thoroughly tested with Jest. Each data structure and algorithm is presented as an independent module, making it easy to study or reuse. The TypeScript versions include type annotations and complexity documentation. While primarily a learning resource, the implementations are production-quality and can be extracted for use in other projects.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 5 reusable components found
marc-mabe/php-enum ★ 498 35 APPLICATION

This repository provides a native PHP implementation of enumeration types, offering base Enum class, EnumSet for efficient set operations, and EnumMap for mapping enum keys to values. The Enum class implements the singleton pattern for enum values, ensuring that equivalent enum values are identical instances, and includes features like lazy constant discovery, inheritance support, and proper comparison handling. The EnumSet component stands out for its innovative bit vector implementation that automatically switches between integer storage (for small sets) and binary string storage (for large sets) to optimize memory usage and performance. It provides standard set operations (union, intersection, difference, symmetric difference) through efficient bitwise operations, making it particularly valuable for applications requiring efficient set manipulation on enum values. The library is well-maintained with comprehensive test suites, benchmarks, and support for multiple PHP versions. It follows semantic versioning and includes development tools for code quality checking. While the EnumSerializableTrait provides serialization support with noted caveats, the core enum functionality is robust and suitable for use in production PHP applications requiring type-safe enumeration patterns.

RATING: 8.8/10 MAINT: maintained DRIFT: low
▸ 1 reusable components found
deckarep/golang-set ★ 4702 291 APPLICATION

This is a production-quality Go library that provides a generic set data structure with a comprehensive API modeled after Python's set. It offers two implementations: a thread-unsafe (fast) version backed by a `map[T]struct{}` and a thread-safe version that wraps the unsafe one with a `sync.RWMutex`. The library supports all standard set operations (add, remove, contains, union, intersection, difference, symmetric difference, subset/superset, equality, clone, pop, filter, iteration) and includes JSON and BSON serialization. It uses Go generics (requires Go 1.18+) and provides build-tag-based optimizations for Go 1.21+ (e.g., `maps.Clone`, `Sorted` function). The codebase is clean, well-tested, and benchmarked, with active maintenance and a strong user base including Ethereum, Docker, and 1Password. The architecture is simple and modular: the `Set` interface defines the contract, `threadUnsafeSet` is the core implementation, and `threadSafeSet` adds concurrency safety. The `Iterator` type provides a cancellable channel-based iteration pattern. The `Elements` function offers a Go 1.23-style iterator. The library is a drop-in replacement for any Go project needing a set collection.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: