Skip to content
/ kcomb Public

Compute (and stream/generate) every possible combination within N sets of data using an implementation of n choose k.

License

Notifications You must be signed in to change notification settings

psaia/kcomb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kcomb

Go

Compute (and stream/generate) every possible combination within N sets of data using an implementation of n choose k.

This could be useful when doing something like generating every possible template string given a set of values for each variable in the template. This works even when the number of variables per template is unknown.

When working with larger sets, this can be resource intensive as results could be in the millions+. The CombineGenerator func will allow you to create a pipeline and efficently iterate without eating much CPU or memory.

See tests and the demo for usage and benchmarking.

go get -u github.com/psaia/kcomb

data stream

About

Compute (and stream/generate) every possible combination within N sets of data using an implementation of n choose k.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages