Showing posts with label Forget everyone else and put the work in. Show all posts
Showing posts with label Forget everyone else and put the work in. Show all posts

Thursday, June 2, 2016

Top 10 Ranking Algorithm problems - June 2016

June 2, 2016

 Julia likes to rank her favorite algorithms and also her practice, then she has to chance to dig into more and develop some skills through the practice.

 Here are top 10 practice she likes most:

1. LRU cache - Leetcode 146 - third practice:
http://juliachencoding.blogspot.ca/2016/06/leetcode-146-lru-cache-practice-makes_2.html

http://juliachencoding.blogspot.ca/2016/06/leetcode-146-lru-cache-practice-makes_45.html

 Practice a few more times.

2. Leetcode 126 - Word Ladder II (hard)  - fifth practice
http://juliachencoding.blogspot.ca/2016/05/leetcode-126-word-ladder-ii-using-bfs.html


3. HackerRank: String - Reverse Shuffle Merge (advanced) 5 practices
https://gist.github.com/jianminchen/7572e92ea48211d3d05c557d97601dbf

4. Serialize and Deserialize Tree - 2 study cases
http://juliachencoding.blogspot.ca/2016/05/leetcode-297-serialize-and-deserialize.html

5. Binary Tree Maximum Path sum - second practice
http://juliachencoding.blogspot.ca/2016/05/leetcode-124-binary-tree-maximum-path.html

6. Binary Tree Preorder Traversal - Iterative solution -
http://juliachencoding.blogspot.ca/2016/05/binary-tree-preorder-traversal.html

7. Leetcode 159 - longest substring with at most two distinct characters
http://juliachencoding.blogspot.ca/2016/05/leetcode-159-longest-substring-with-at.html

8. Leetcode 236 - Binary Tree Lowest Common Ancestor - Recursive, Backtracking 
First blog: (5 practices)
http://juliachencoding.blogspot.ca/2016/05/leetcode-236-lowest-common-ancestor.html
Second blog:
http://juliachencoding.blogspot.ca/2016/05/leetcode-236-lowest-common-ancestor_21.html

Third blog:
http://juliachencoding.blogspot.ca/2016/05/leetcode-236-lowest-common-ancestor_22.html

Fourth blog:
http://juliachencoding.blogspot.ca/2016/05/leetcode-236-binary-tree-lowest-common.html

9. Binary Tree Post Order Traversal - Iterative solution
http://juliachencoding.blogspot.ca/2016/05/binary-tree-post-order-traversal.html

10. Leetcode 17: Phone Number Combination
http://juliachencoding.blogspot.ca/2016/04/window-sum.html

There are so many algorithms to list here. But just keep 10 a time.

Saturday, May 28, 2016

Leetcode 126: word ladder II - warm up practice

May 28, 2016

  Share professional tennis player Kristina Mladenovic tweet:
https://twitter.com/kikimladenovic/status/732966170375114752

I know what it takes to win. Forget everyone else and put the work in.

Spend one hour to work on the word ladder II, Leetcode 126.
Previous blog:
http://juliachencoding.blogspot.ca/2016/05/leetcode-127-word-ladder-medium_24.html work on one test case:
hit-> cog
Dictionary<string, int> has entries:
Let us talk about a test case to help understand the work:
           hit -> cog
           Two transformation paths:
                         dot -> dog
           hit -> hot ->            -> cog
                         lot -> log
                         
           dist value is 5
           Dictionary<string, int>
           key    value      new value
           hit     0            4
           hot     1            3
           dot     2            2
           lot     2            2
           dog     3            1
           log     3            1
           cog     4            0

Extract a function called resetDistanceFromEnd

 https://gist.github.com/jianminchen/ca720a93cb8e8fd12610ba58fef9889f