Saturday, July 28, 2018

Leetcode 111: minimum depth of binary tree

July 28, 2018


Introduction


It is an easy tree level algorithm called minimum depth of binary tree. I like to consider two ideas, one is to use breadth first search and then shortest path and then terminate search early. Another one is to use recursive function to do depth first search, to prune the search, if the current depth is bigger than minimum depth found so far, then current path should be terminated.

My practice


Here is my C# code. My first practice failed on one test case. My base case is wrong. I should consider the base case with a node not null, but left child and right child both are null. Null node should not be considered as a base case.




weekend planning - 80 facebook algorithms on Leetcode.com

July 28, 2018

Introduction


It is time for me to make my summer weekend special one. I choose to work on facebook algorithm 80 of them on Leetcode.com.

I will plan to work on a few hours based on the list of algorithms

Here is the list I prepared before.


weekend planning - easy level array algorithm

July 28, 2018

Introduction


It is time for me to solve as many easy level algorithms as possible. So I can review my last two week practice and I will be so happy to know that I solve 50 algorithms in last two weeks, and also I work full time 80 hours last weeks.

It is not easy to move on next algorithm quickly. In order to do that, I have to train myself focus on analysis and coding. Cut emotional baggage for each algorithm, how I feel, what my concerns, I should learn quickly and move forward with another problem solving.

Easy level array algorithms


I like to list those algorithms here. I like to solve 10 easy level array algorithms this weekend. The number of easy level array algorithms is around 45 to 50.


665 19.9%Easy
189 26.3%Easy
414 28.2%Easy
532 28.4%Easy
581 29.4%Easy
605 30.0%Easy
88 32.8%Easy
219 33.3%Easy
840 34.3%Easy
624 35.8%Easy
26 37.3%Easy
643 37.8%Easy
849 38.1%Easy
1 38.6%Easy
724 39.2%Easy
119 39.3%Easy
66 39.9%Easy
35 40.0%Easy
747 40.4%Easy
53 40.8%Easy
118 41.3%Easy
27 41.5%Easy
674 42.7%Easy
746 43.8%Easy
121 43.8%Easy
628 44.8%Easy
268 45.7%Easy
830 46.7%Easy
661 46.8%Easy
697 47.0%Easy
167 47.4%Easy
217 48.1%Easy
122 48.6%Easy
169 49.0%Easy
717 49.0%Easy
448 51.3%Easy
283 52.1%Easy
695 52.2%Easy
485 53.8%Easy
243 54.2%Easy
566 57.7%Easy
766 58.2%Easy
561 66.8%Easy
867 66.8%Easy
832 69.2%Easy