UNPKG

@dxzmpk/js-algorithms-data-structures

Version:

Algorithms and data-structures implemented on JavaScript

22 lines (19 loc) 388 B
import btPowerSet from '../btPowerSet'; describe('btPowerSet', () => { it('should calculate power set of given set using backtracking approach', () => { expect(btPowerSet([1])).toEqual([ [], [1], ]); expect(btPowerSet([1, 2, 3])).toEqual([ [], [1], [1, 2], [1, 2, 3], [1, 3], [2], [2, 3], [3], ]); }); });