Exercises
Browse All Exercises
Search and filter across the entire exercise library.
Filters
97 exercises
medium
Python
Course Prerequisite Cycle Detection
Build a function that determines if you can finish all courses given a list of prerequisite pairs. This is a classic cyc...
graph-algorithms
cycle-detection
dfs
+6
medium
Python
Island Counter - 2D Grid Traversal
Write a function that counts the number of islands in a 2D binary grid. An island is surrounded by water and is formed b...
algorithms
graph-traversal
dfs
+6
medium
Python
Binary Tree Level Order Traversal
# Binary Tree Level Order Traversal Implement a function that performs level order traversal of a binary tree and retur...
binary-tree
breadth-first-search
bfs
+6
medium
Python
Binary Search Tree Validator
# Binary Search Tree Validator Implement a function that determines if a binary tree is a valid binary search tree (BST...
binary-tree
binary-search-tree
recursion
+6
easy
Python
Binary Tree Maximum Depth
Write a function that finds the maximum depth (height) of a binary tree. The depth of a binary tree is the number of no...
binary-tree
recursion
tree-traversal
+5
easy
Python
Invert Binary Tree
Write a function that inverts a binary tree (creates a mirror image) and returns the root node. Inverting a binary tree...
binary-tree
recursion
tree-traversal
+5
hard
Python
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-structures
algorithms
hash-map
+5
medium
Python
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
two-pointers
in-place
+3
medium
Python
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
two-pointers
merging
+4
medium
Python
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
two-pointers
one-pass
+2
easy
Python
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
two-pointers
cycle-detection
+3
easy
Python
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...
linked-list
pointers
data-structures
+2
Previous
Page 7 of 9
Next