Saturday, January 6, 2018

Dynamic programming practice

January 6, 2018

Introduction


It was another 10:00 PM mock interview. I wrote the algorithm called number of path. At first I wrote the algorithm using O(n2) space, and then I was asked about space complexity, so I noticed that the space complexity can be optimized to O(n) space.

The C# code with space O(n2) is here. And the C# code with space O(n) is here.



No comments:

Post a Comment