LeetCode(876)
通过的代码:


typedef struct ListNode LNode;
typedef struct ListNode *LNode_Pointer;
struct ListNode* middleNode(struct ListNode* head)
{
    LNode_Pointer p,q;
    p=head;
    q=head;

    while(p!=NULL&&q->next!=NULL)
    {
        if(p->next!=NULL&&q->next->next!=NULL)
        {
            p=p->next;
            q=q->next->next;
        }
        else if(q->next!=NULL)
        {
            return p->next;
        }
    }
    return p;
}

提交结果:
LeetCode(876)

我好强啊,哇哈哈。(其实菜的一匹)

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-02-23
  • 2022-12-23
  • 2022-01-08
  • 2021-10-05
  • 2021-08-12
猜你喜欢
  • 2021-05-05
  • 2022-12-23
  • 2021-07-08
  • 2022-02-20
  • 2022-02-21
相关资源
相似解决方案