Starting from:
$35

$29

In-class 4 Solution

Write a recursive method countBinStr that takes one integer parameter n as input, and returns the number of binary strings of length n that do not have two consecutive 0's. For example, for n = 4, the number of binary strings of length 4 that do not contain two consecutive 0's is 8, and they are: 1111, 1110, 1101, 1011, 1010, 0111, 0110, 0101

More products