[合集] 一道微软面试题# 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
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