This repository contains my solutions for the course WIA1002 Data Structure(DS) in Universiti of Malaya in Year 1 Sem 2. The programming language mainly used in this course used is Java
| Topic | Tutorial | Lab |
|---|---|---|
| Object-Oriented Programming (OOP) | Tutorial 01 | Lab 01 |
| Generics | Tutorial 02 | Lab 02 |
| ADT and Bag | Tutorial 03 | Lab 03 |
| Singly Linked List | Tutorial 04 | Lab 04 |
| Doubly Linked List | Tutorial 05 | Lab 05 |
| Stack | Tutorial 06 | Lab 06 |
| Queue | Tutorial 07 | Lab 07 |
| Priority Queue | Tutorial 07b | Lab 07b |
| Graph | Tutorial 08 | Lab 08 |
| Recursion | Tutorial 09 | Lab 09 |
| Search and Sort | Tutorial 10 | Lab 10 |
| Binary Search Tree (BST) | Tutorial 11 | Lab 11 |
HashMap-related questions can be ignored, as they are no longer part of the syllabus — but feel free to try them for your own learning and practice.
Common Instruction:
No marks will be given for any implementation using the existing Data Structure class or any other Collection classes available from the Java API Library.
These problems emphasize manual (from-scratch) implementation of core data structures — without relying on Java's built-in Collection classes e.g. java.util.Stack, java.util.Queue.
In other words, you are expected to build your own versions of these data structures (creating a custom Stack class using arrays or linked lists).
These past year questions are great for strengthening your foundational understanding of
- Stacks using basic array implementation or linked list
- Queues using circular array implementation or circular linked list
💡 Suggestion:
I recommend starting with array-based implementations since most questions require your custom classes to handle a fixed size limitation. Linked lists are more dynamic, flexible and easier to work with once you have mastered the fundamentals.
These past-year questions are great practice for mastering Stack and Queue topics in Java:
| Semester | Question | Concepts used | Link |
|---|---|---|---|
| 2016 sem 2 | Bracket Matching | Array StackFile Handling (Read File) |
WIA1002_2_2016 Q2 |
| 2017 sem 1 | Reversing a String | Array Stack |
WIA1002_1_2017 Q3 |
| 2019 sem 2 | Maze Backtracking |
Linked List StackFile Handling (Read File) |
WIA1002_2_2019 Q3 |
| 2020 sem 1 | Generic Stack | Array Stack |
WIA1002_1_2020 Q1 |
| 2020 sem 1 | Generic Queue | Circular Array |
WIA1002_1_2020 Q2 |
| 2020 sem 1 | Generic Queue | Circular Linked List |
WIA1002_1_2020 Q2 |
| Semester | Link |
|---|---|
| 2016 Sem 2 | 📂 WIA1002_2_2016 |
| 2017 Sem 1 | 📂 WIA1002_1_2017 |
| 2017 Sem 2 | 📂 WIA1002_2_2017 |
| 2018 Sem 1 | 📂 WIA1002_1_2018 |
| 2019 Sem 1 | 📂 WIA1002_1_2019 |
| 2019 Sem 2 | 📂 WIA1002_2_2019 |
| 2020 Sem 1 | 📂 WIA1002_1_2020 |
This format is more similar to WIX1002 Fundamentals of Programming(FOP) — focused on:
- Applying logical thinking skills
- File Handling
- Moderate use of data structures
Unlike Format 1, these questions do not strictly require you to build everything from scratch.
In fact, some questions explicity allow the use of Java Collection classes like PriorityQueue.
🧠 This format is great for practicing problem-solving and working with real-world-like input/output scenarios.
| Semester | Question | Concepts used | Link |
|---|---|---|---|
| 2022 sem 2 | Full Graph Implementation | Linked List |
WIA1002_2_2022 Q6 |
| 2024 sem 2 | Graph Adjacency Matrix and Depth-First Search(DFS) | ArrayRecursion |
WIA1002_2_2024 Q42b |
| 2025 sem 2 | Full Graph Implementation | ArrayList |
WIA1002_2_2025 Q4 |
💡 Suggestion:
In most textbooks and lectures, adjacency lists in graph are commonly implemented usingLinkedList. However, for exams, I generally prefer usingArrayListfor its simplicity and ease of implementation. It makes the code faster to write and debug — ideal for exams or quick from-scratch implementations. That said, both approaches are valid — feel free to use whatever works best for you!
✨ Honourable Mention: 📂 WIA1002_2_2023
This question set is notoriously cutthroat — requiring deep logical reasoning and intense problem-solving. Personally, I consider it as the most hellish paper I have ever faced. 😵💫
| Semester | Link |
|---|---|
| 2021 Sem 2 | 📂 WIA1002_2_2021 |
| 2022 Sem 2 | 📂 WIA1002_2_2022 |
| 2023 Sem 2 |
📂 WIA1002_2_2023 |
| 2024 Sem 2 | 📂 WIA1002_2_2024 |
This is a closed test paper but the question topics are listed as below:
| Question | Topic | Subtopics / Focus Areas |
|---|---|---|
| Q1 | Linked List | Singly Linked ListDoubly Linked List |
| Q2 | Queue | Circular Array ImplementationCustom Priority Queue |
| Q3 | Search and Sort | Insertion SortBinary SearchFile-Handling (Read File) |
| Q4 | Graph | From-scratch Graph ImplementationDFS using Stack/Recursion |
| Semester | Link |
|---|---|
| 2025 Sem 2 | 📂 WIA1002_2_2025 |
Feel free to fork and submit a pull request to improve my content. Thanks!
Deep Apologies! Sorry that I can't remember all of the names of seniors that help me throughout this course but here are the repositories I usually refer to