注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
和几个小时前的废丝面试背靠背,刚刚面完。感觉比一面简单,不过如果挂了我也没啥意外的。。。第一题就是 sort color
/*
sort priority
*/
class Thing : SuperThing {
int get_priority(); // 0, 1, 2, 3
}
这是我的code:
// If possible, I'd like this to take linear time and constant extra space.
// 这里说了另外一个思路,vector<int> Count(4,0);
void sort_priority( vector<Thing>& thingghter的bound是啥,我后来说是O(n),解释如下
// for each node , twice when we search this node, its left child search back, the rightmost childe search back, O(n)
嗯。。。
补充内容 (2017-3-25 01:15):
好吧。收到拒信了。。。 |