Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. how many subsets are in an array of n integers?
- 2. how many non-empty subsets are in an array of n integers?
- 3. how many distinct subsets are in an array of n integers? (2 1 2)->count(2=2,1=1)->((2+1)*(1+1)-1)=5;mul of 1 to inf(operation (occurence+1) multiply with minus 1.
- 4. find the number of a different binary subsequences of length n such that no two 0's are adjacent?
- n=2->00,01,10,11->ans is 3,n=3->ans is 5,n=4->ans is 8;that means 3 5 8 13 sequence maintain,(Fibonacci series).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement