Posts

Showing posts from November, 2017

General

1. One page resume 2. Don't write Useless words (interest, like "strong problem solving ability)   不要写废话 3. Don't talk to much to too few (don't disturb the interviewer write code). Don't BB too much while coding.

Tree Summary

Tree Traversal (1)  Pre-Order, In-Order, Post-Order (recursion and iterative)        144   Binary Tree Preorder Traversal          Iterative: Using a stack, push the root into stack first. While the stack is not empty. pop and          visit the top node. If the right (note here we push the right before left, so when pop, we will         visit left before right) child is not NULL,  push the right child into stack. If the left child is         not NULL, push the left into stack. Keep doing this until all the nodes are visited. (2)   173 Binary Search Tree Iterator     This problem is actually Iterative inOrder traversal      maintain a  pushLeft function and a data member stack<TreeNode*> st. Call pushLeft in      the constructor BSTIterator. ...

Bug Free

Bug log: 1. 2. 3.

Coding style

Lintcode to check your coding style.