Cody

Solution 1802241

Submitted on 1 May 2019 by Joanne Marsh
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
assert(bit_reverse(1,1) == 1)

y = 0 k = 0 vec = 0 vec = 1 x = 0 y = 1 k = -1

2   Pass
assert(bit_reverse(4,3) == 1)

y = 0 k = 2 vec = 0 0 0 vec = 0 0 0 x = 2 vec = 0 0 0 x = 1 vec = 0 0 1 x = 0 y = 0 k = 1 y = 0 k = 0 y = 1 k = -1

3   Pass
assert(bit_reverse(2,3) == 2)

y = 0 k = 2 vec = 0 0 0 vec = 0 0 0 x = 1 vec = 0 1 0 x = 0 vec = 0 1 0 x = 0 y = 0 k = 1 y = 2 k = 0 y = 2 k = -1

4   Pass
assert(bit_reverse(6,3) == 3)

y = 0 k = 2 vec = 0 0 0 vec = 0 0 0 x = 3 vec = 0 1 0 x = 1 vec = 0 1 1 x = 0 y = 0 k = 1 y = 2 k = 0 y = 3 k = -1

5   Pass
assert(bit_reverse(5,3) == 5)

y = 0 k = 2 vec = 0 0 0 vec = 1 0 0 x = 2 vec = 1 0 0 x = 1 vec = 1 0 1 x = 0 y = 4 k = 1 y = 4 k = 0 y = 5 k = -1

6   Pass
assert(bit_reverse(7,3) == 7)

y = 0 k = 2 vec = 0 0 0 vec = 1 0 0 x = 3 vec = 1 1 0 x = 1 vec = 1 1 1 x = 0 y = 4 k = 1 y = 6 k = 0 y = 7 k = -1