educative.io

About the Recursive - Solution Set 3 category


#1

Solutions to problem set 3

View the lesson here.


#2

The explanation to Question 2 / Solution Set3 is confusing (me). It ends with the sentence: “the series … sums up to n(n+1)/2 which is again O(n).” This by itself is wrong. I assume that idea was to explain that the cost of each invocation of ‘permutate’ is O(n). I would add that the cost of the whole computation of permutate(array, 0) is still O(n!).