Exercises

Browse All Exercises

Search and filter across the entire exercise library.

97 exercises

mediumPython
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
mediumPython
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...
algorithmsgraph-traversaldfs+6
mediumPython
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-treebreadth-first-searchbfs+6
mediumPython
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-treebinary-search-treerecursion+6
easyPython
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-treerecursiontree-traversal+5
easyPython
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-treerecursiontree-traversal+5
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-listtwo-pointersin-place+3
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-liststwo-pointersmerging+4
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-listtwo-pointersone-pass+2
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-listtwo-pointerscycle-detection+3
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...
linked-listpointersdata-structures+2
PreviousPage 7 of 9Next