Monday, August 27, 2018

Leetcode 53 - Maximum subarray - divide and conquer

August 27, 2018

Introduction


It is my big surprise that I reproduced the problem I have. I could not think clearly when I write the code and work on the algorithm Leetcode 53, Maximum subarray. Same problem I had two months ago. I have issues to work with time complexity and I need to figure out how to train myself.

I have practiced over 40 algorithms. I was able to work on an easy level algorithm, and then reproduce the problem I have in analysis of the algorithm.

My task is to continue to practice, let me fail a few more times. I should start to fix the issue.

My failed practice


Here is my C# code I wrote using divide and conquer, but I had problems to continue since there are a few issues.

I spent over 30 minutes on this practice. The subproblems defined in my practice solution have not been calculated properly. The subproblem is not well-defined, and it does not help to problem solution.



No comments:

Post a Comment