|
此文章由 seabookf_91 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 seabookf_91 所有!转贴必须注明作者、出处和本声明,并保持内容完整
xxmplus 发表于 2013-1-8 17:35 
还是基础问题多,也不是很难
Seriously?
This is the Interview Questions, try to do this in 30 mins.
1) LRU Cache Implementation.
If the cache is full then find the least recent used item in the cache, evict this item and replace it with new cached item.
2) Tree Question.
Random Binary Tree.
Node {
Node left;
Node right;
Node next;
}
Write a function called populateNextNode(Node) {} to traverse the tree and set all the relevant next node in each node.
(1)
/ \
(2) ---> (3) Node2.next is Node3
/ / \
(4) --->(5) -->(6) Node4.next is Node5, Node5.next is Node6
\ \
(7) -------> (8) Node7.next is Node8 |
|