Tag Archives: Linked List

Reverse Linked List Recursive

Reverse linked list data structure Given a singly linked list. Write a function to reverse the linked list recursively Reverse linked list algorithm The linked list can be viewed as the concatenation of the first node and the rest of …

Read more »

Reverse linked list c++

Reverse linked list data structure Given a singly linked list. Write a function that reverses the linked list. Provide explanation and logic. Reverse linked list solution An iterative solution is to use two pointers. The first pointer points to the …

Read more »

Circular linked list in c++

Circular linked list data structure This is a typical interview question. Given a singly linked list. Write a function that detects if the linked list is circular (has a loop) which means the last node points to another node in …

Read more »

Find the nth node from the end of a linked list

Get nth node linked list problem Given a singly linked list. Write a function that returns the nth node from the end of the list. How to find nth node in linked list Let (n) be the position (from the …

Read more »