阅读背景:

如何在给定头节点的情况下递归地找到链表中的最大项?

来源:互联网 
int findLargest (ListNode *p)
// --------------------------------------------------------------------------
// Preconditions: list head pointer is passed as a parameter.
// Postconditions: returns the largest value in the linked list.
// --------------------------------------------------------------------------
{
    if (p->item != NULL)
    {
        int largest = p->item;
        if (largest > p->next->item)
            ...
    }

    ...
}
int findLargest (ListNode *p)
// --------------



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: