Swap the first and last node of a singly linked list
Filed under Veritas
The question
Write code to swap the first and last nodes of a given singly linked list.
No write-up yet. Related questions below have one.
Related Veritas questions
Collected from public candidate posts and coding forums. Updated Nov 2026.