avatar
[合集] 一道微软面试题# Programming - 葵花宝典
c*d
1
☆─────────────────────────────────────☆
GTO (呵呵) 于 (Sun Aug 5 15:56:59 2007) 提到:
Implement the following function for sorting a linked list of integers in
ascending order.
Your function should use only a constant amount of memory.
It's prohibited to change the value of ListNode, instead ListNodes must be
rearranged.
struct ListNode
{
int value() { return _value; }
ListNode *pNext;
private:
int _value;
};
ListNode* SortList(ListNode *pHead)
{
// Insert your implementation
avatar
l*c
2
指出一点哈,带flag的bubble sort也是O(n) best case.
avatar
j*g
3
If it's a coding question, your coding style is more important than the
algorithm.
I've applied 2 positions in Ms. Both requires write code, phone screen, and
on-site interview. For the first position, I did alright in emailed prob.
But for phone interview, I wrote incorrect code and emailed the interviewer
after the phone screen. Then I realize the prob and send him a updated
version. I got a on-site.
For the 2nd position, I made a big bug in the email programs (new [] but
delete without []). T
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。