ldm-partition
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

JavaScript implementation for largest differencing method

Implementation based on algorithm invented by Narendra Karmarkar and Richard M. Karp.

Install

npm install ldm-partition

Usage

import partition from 'ldm-partition';

partition([8, 7, 6, 5, 4], 2);
//=> [[4, 7, 5], [8, 6]]

partition([{ x: 2 }, { x: 4 }], 2, (d) => d.x));
//=> [[{ x: 4 }], [{ x: 2 }]]

Package Sidebar

Install

npm i ldm-partition

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

8.03 kB

Total Files

6

Last publish

Collaborators

  • overengineered