# kanwei/algorithms

Ruby algorithms and data structures. C extensions

Repository: https://github.com/kanwei/algorithms
Canonical: https://ross.abutalabs.com/products/kanwei-algorithms
Homepage: http://kanwei.github.io/algorithms/
Language: Ruby
License: MIT
License Family: permissive
Last push: 2026-02-28T19:30:25+00:00

## Health v2 (maintenance only)
Score: 63/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 69, release rhythm 35, longevity 100
- inputs: {"age_days": 6628, "days_push": 186, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2697, forks 342 (observed 2026-08-28T04:07:11.245184+00:00)

## What it is
A Ruby library providing common algorithms and data structures such as heaps, red-black trees, tries, suffix arrays, sorting, and searching routines. Optional C extensions deliver significant performance improvements where available.

## Use cases
- use a red-black tree or splay tree in Ruby
- sort collections with quicksort or mergesort in Ruby
- implement a priority queue in Ruby
- perform binary search or KMP string search in Ruby
- use heaps, deques, stacks, and queues in Ruby
- benchmark data structure performance in Ruby

## When to choose
- you need efficient data structures not in Ruby's standard library
- you want documented guidance on which structure or algorithm to use
- you can use C extensions for performance-critical Ruby code

## When to avoid
- you need algorithms in a language other than Ruby
- you only need structures already provided by Ruby's core library
- you need actively developed cutting-edge algorithm implementations

## Facets
- artifact type: library
- maturity: maintenance
- function: developer-tools
- domain: developer-tools
- platform: ruby, jvm, cross-platform
- tags: data-structures, sorting, searching, c-extensions, containers, algorithms

## Member repositories
- kanwei/algorithms (main) score 63

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:11.245184+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:16:13.261158+00:00, confidence not recorded.
  - readme: https://github.com/kanwei/algorithms (fetched 2026-08-28T04:07:11.245184+00:00, sha b4b656d8b7f9)
  - homepage: http://kanwei.github.io/algorithms/ (fetched 2026-08-29T09:59:17.483442+00:00, sha 4f5f497817e3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
