Question: please do in haskell just need help with this problem and can you do it in a recursive way Powerset, preserves normalization. Examples: power []
Powerset, preserves normalization. Examples: power [] = [[ ]] power [1] = [[],[1]] power [1,2] = [[],[1],[1,2],[2]] power [1,2,3] = [[],[1],[1,2],[1,2,3],[1,3],[2],[2,3],[3]] power :: [a] -> [[a]] power [] = [0]] power [x] = [[],[x]] x = head of list xs tail of the list power (x:xs) = undefined
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
