leetcode/include/s0206_reverse_linked_list.hpp

19 lines
389 B
C++
Raw Normal View History

2022-12-02 08:06:34 +00:00
#ifndef S0206_REVERSE_LINKED_LIST_HPP
#define S0206_REVERSE_LINKED_LIST_HPP
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) {}
};
class S0206 {
public:
ListNode* reverseList1(ListNode* head);
ListNode* reverseList2(ListNode* head);
};
#endif