![]() |
linked-list-cycle 1.0.0
Linked List Cycle
|
Public Member Functions | |
| bool | has_cycle_2 (ListNode *head) |
| Check if the list has a cycle using set<ListNode*> | |
| bool | hasCycle (ListNode *head) |
| Check if the list has a cycle using fast and slow pointers. | |
|
inline |
Check if the list has a cycle using set<ListNode*>
Definition at line 74 of file main.cpp.
References ListNode::next.
|
inline |
Check if the list has a cycle using fast and slow pointers.
Definition at line 91 of file main.cpp.
References ListNode::next.
Referenced by main().