Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A simple library to solve linear partitioning problem [O(n²)]

NotificationsYou must be signed in to change notification settings

technically-php/linear-partitioning

Repository files navigation

Based on a description fromThe Algorithm Design Manual book bySteven S. Skiena.

  • Leverages the Dynamic Programming principle
  • O(n²) complexity
  • Fully annotated code
  • Test suite
  • Semver

Installation

composer require technically-php/linear-partitioning:^1.0

Usage

use \TechnicallyPhp\LinearPartitioning\LinearPartitioning;$items = [100,200,300,400,500,600,700,800,900];$ranges = LinearPartitioning::partition($items,3);var_dump($ranges);// [ [100, 200, 300, 400, 500], [600, 700], [800, 900] ]

Credits

About

A simple library to solve linear partitioning problem [O(n²)]

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp