Practice Exercises
Welcome to the practice exercises hub! Here you can access practice programming exercises for various topics discussed in the course, such as linked lists, trees and graphs.
Linked Lists
- List is Ordered
- List is Palindromic
- List is K-Periodic
- Counting Duplicates
- Reversing a Linked List
- Reversing a Doubly Linked List
- Inserting into the Nth Position
- Deleting the Largest Value
- Deleting Duplicate Values
- Zipping Two Lists
- Merging Two Ordered Lists
- Union of Two List Sets
- Intersection of Two List Sets
- Difference of Two List Sets
Trees
- Postfix Traversal of a BST
- Smallest Value in a BST
- Kth Smallest Value in a BST
- Deleting the Largest Value in a BST
- Tree is Size Balanced
- Copying a Tree
Graphs
- Shortest Distance Between Vertices
- Number of Reachable Vertices
- Furthest Reachable Vertex
- Is there a Cycle?
- Number of Vertices Within Distance
External Resources
LeetCode/HackerRank problems for more practice
This is a curated list of relevant problems from LeetCode and HackerRank created by James, a former COMP2521 tutor.
Solutions
Solutions are available, but please note that you should make a reasonable attempt on each exercise before looking at its solution. The goal of these exercises is not for you to see how quickly you can complete them - it is for you to develop and improve your problem solving skills.