📜  单链表的定义 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:52.803000             🧑  作者: Mango

代码示例1
# Definition of a singly linked list - C++
struct ListNode {
    int val;    
    ListNode *next;
     ListNode() : val(0), next(nullptr) {}
      ListNode(int x) : val(x), next(nullptr) {}
     ListNode(int x, ListNode *next) : val(x), next(next) {}
};