Programming Reflection Mar 12

1 Tree question is usually related with Recursion.

2 Recursion: status in current level, status before return to upper level, status after return from lower level. (i.e. LCA problem (LC 236), Return – TreeNode – Whether one of the two nodes is found in current subTree, Before Recurse down – check root, After Return Back – check what is returned from subtrees)

3 Recursion: Before Recurse Down – check whether current root.val maintains a consecutive sequence, Recurse Down – pass current length and root value to next level, Return max length of current and next level (i.e. Binary Tree Longest Consecutive Sequence (LC 298))

4 Access two children(left and right) simultaneously instead of using extra space to store the serialized tree elements value (i.e. Symmetric Tree (LC 101) )

5 Dynamic Programming tips: find a base case, cache as much as possible for further usage (LC longest palindrome substring)

6 iOS Tips: UIWindow holds different UIView and never be replaced. UIViewController manages UIView and subviews. CALayer is responsible for specific visual content, like animation or sophisticated visual effects.

Advertisements

About liyao13

Yao Li is a web and iOS developer, blogger and he has a passion for technology and business. In his blogs, he shares code snippets, tutorials, resources and notes to help people develop their skills. Donate $5 to him for a coffee with PayPal at About Me page and read more professional and interesting technical blog articles. Follow him @Yaoli0615 at Twitter to get latest tech updates.
This entry was posted in CS Research&Application, Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s