April 26, 2016
To master this DFS algorithm, Julia likes to do more practice. Every time she practices, she finds new issue, new concern. She also knows that to memorize a solution is not a good idea, do not focus on what you remember about the algorithm, even you have some memory about the algorithm and solution. You may have to solve a totally different problem.
Leetcode 17 phone number combination
Review the blog:
http://juliachencoding.blogspot.ca/2016/01/leetcode-17-letter-combinations-of.html
One more practice - write the code using the same idea, still makes a bug, and learn how to do fast coding, add more explanation variable, and temporary variable.
https://gist.github.com/jianminchen/acbbf5fbd5fefa1a9fb2f7b3664bf4ed
https://gist.github.com/jianminchen/90ac4390929704ce439d0a1f255f4546
Make function more flat, close to left side, more readable - remove if/ else statement in the function, more flat; also, more readable code, less chance to have a bug.
https://gist.github.com/jianminchen/b866a5c331556ea8f36aecfe123befea
Reading:
https://msdn.microsoft.com/en-us/library/zcbcf4ta.aspx
http://geekswithblogs.net/robp/archive/2008/08/13/speedy-c-part-3-understanding-memory-references-pinned-objects-and.aspx
Question and Answer:
Julia has some concerns about recursive function, she will find some articles to read:
1. General about stack, recursive function.
2. How to check using C# - recursive argument one copy or its own copy?
3. Play safe, use extra variable to save the value.
From January 2015, she started to practice leetcode questions; she trains herself to stay focus, develops "muscle" memory when she practices those questions one by one. 2015年初, Julia开始参与做Leetcode, 开通自己第一个博客. 刷Leet code的题目, 她看了很多的代码, 每个人那学一点, 也开通Github, 发表自己的代码, 尝试写自己的一些体会. She learns from her favorite sports – tennis, 10,000 serves practice builds up good memory for a great serve. Just keep going. Hard work beats talent when talent fails to work hard.
Thursday, April 21, 2016
Leetcode 17 Phone number combination - practice (II)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment