leetcode 141. Linked List Cycle

Given a linked list, determine if it has a cycle in it.

To represent a cycle in the given linked list, we use an integer pos which represents the position (0-indexed) in the linked list where tail connects to. If pos is -1, then there is no cycle in the linked list.


leetcode 24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.

You may not modify the values in the list’s nodes, only nodes itself may be changed.

Example:

1
Given 1->2->3->4, you should return the list as 2->1->4->3.

leetcode 206. Reverse Linked List

Reverse a singly linked list.

1
2
Input: 1->2->3->4->5->NULL
Output: 5->4->3->2->1->NULL

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×