LeetCode 24 | Swap Nodes in Pairs | Solution Explained (Java + Whiteboard)

Опубликовано: 01 Ноябрь 2024
на канале: Xavier Elon
1,228
33

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.

Running Time: O(n)
Space Complexity: O(1)

Github: https://github.com/xavierelon1
Github HackerRank Solutions: https://github.com/XavierElon1/Hacker...
Github Leetcode Solutions: https://github.com/XavierElon1/LeetCo...
Facebook:   / xavier.hollingsworth.3  
Instagram:   / xavierelon  
LinkedIn:   / xavier-hollingsworth-524144127  
Twitter:   / elon_xavier