UNPKG

@dxzmpk/js-algorithms-data-structures

Version:

Algorithms and data-structures implemented on JavaScript

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