s****t 发帖数: 467 | 1 刚面完,发面经攒rp
1. lead: find the most frequent word(s) in a Word doc. What are the things
you need to clarify before coding?
用hashtable,注意多个单词有相同最高频率的情况
2. dev: 1) clone a linked list (get an exactly same copy of the original
list)
2) clone a linked list with pointers not only to the next node, but
also to the node after the next
3) clone a linked list with two pointers, one to the next node, the
other to a random node in the list or null
对每个节点都新建一个相应的节点,再连起来
random指针那问,可以建一个表,存新老节点的 |
|