Practice pointer manipulation, reversal, cycle detection, and merge operations — classic interview staples that test your understanding of data structures.
6 exercises
hardPython
LRU Cache with O(1) Operations
# LRU Cache Implementation
Implement an LRU (Least Recently Used) cache that supports `get(key)` and `put(key, value)`...
data-structuresalgorithmshash-map+5
mediumPython
Reorder Linked List In-Place
# Reorder Linked List In-Place
Given a singly linked list, reorder it in-place to alternate between nodes from the begi...
linked-list
mediumPython
Merge Two Sorted Linked Lists
Write a function that merges two sorted linked lists into one sorted linked list.
The function should take two linked l...
linked-lists
mediumPython
Remove Nth Node from End of Linked List
# Remove Nth Node from End of Linked List
Implement a function that removes the nth node from the end of a linked list...
linked-list
easyPython
Cycle Detection in Linked Lists
# Cycle Detection in Linked Lists
Implement a function that detects if a linked list has a cycle using Floyd's cycle de...
linked-list
easyPython
Reverse a Singly Linked List
Write a function that reverses a singly linked list in-place and returns the new head node.
A singly linked list is a d...