Thursday, February 8, 2018

Leetcode 54: Spiral matrix - think recursively

Feb. 8, 2018

Introduction


It is my idea how to train myself in the practice. It is to involve the discussion of Leetcode. Every algorithm I should give out 10 votes for 10 different ideas, and also write C# code based on the idea.

I did some research based on my practice of Leetcode 301 recently, and I found out that my practice has some issue. And I wrote a blog how to learn a hard level algorithm on Leetcode.com.


Recursive solution


I studied the solution today, and I like to write a C# code based on the idea. It is the great warm up of recursive function, and also nice to review base cases in the design of recursive function. Here is the C# code.



No comments:

Post a Comment