Skip to content

Subset Tree

Latest
Compare
Choose a tag to compare
@dshea89 dshea89 released this 05 May 13:00
· 1 commit to master since this release

A heap-ordered tree structure consisting of n-length subsets of a set. Solutions for the subset sum problem exist in which min-heap trees may be wielded to order all subsets by their sum and then traversed appropriately. By applying a binary search on the list of all sum-ordered subsets, a solution may be found relatively quickly. However, this approach only works for subsets in which all values are positive. The provided code extends this approach to include sets with all values, both positive and negative, by employing a new data structure termed the subset tree.