Category 2: Algorithms and Data Structures
The artifact I selected for this milestone is a full-stack web application originally developed as a console-based Java Program for managing rescue animals. The original program used arrays and procedural logic to handle user input and manage animal data entirely in memory using ArrayLists. Each operation required manual iteration through lists using basic for-loops, which resulted in O(n) time complexity for searching and filtering operations.
To align with the Algorithms and Data Structures category, I enhanced the application by adding dynamic filtering, sorting, and efficient querying capabilities. The updated version stores animal records in MongoDB, uses Spring Boot for the backend, and Angular for the frontend. Filtering logic was redesigned to use database queries instead of in-memory loops, allowing multiple filters such as animal type, size, age range, and availability, along with sorting options.
Filtering Enhancements
Originally, searching for animals involved scanning each item in the list manually, which becomes inefficient for large datasets. In the enhanced version, this is replaced by MongoDB queries using indexed fields, significantly improving query time to O(log n) or even O(1) for simple lookups. The filtering system was implemented using checkboxes and numerical inputs that dynamically update query parameters sent to the backend. The backend constructs MongoDB queries based on active filters, validating parameters before building the query to avoid conflicting filters.
Original Linear Search Example:
for (Dog dog : dogList) {
if (dog.getTrainingStatus().equalsIgnoreCase("in service") && !dog.getReserved()) {
availableList.add(dog);
}
}
Enhanced MongoDB Filtering:


Sorting Enhancements
Originally, animals were displayed in the order they were added, with no sorting options. In the enhanced version, sorting is implemented using Spring Data's Sort object. Users select sorting options from a dropdown, which are passed to the backend where sorting is applied directly in the MongoDB query.

Pagination and Reset
Pagination was added to keep the frontend responsive by limiting results displayed per page. A reset button allows users to clear all filters and start fresh.
Enhancement Pagination Backend Code:

Problem Solving
During development, I encountered issues with overlapping filter conditions when multiple filters were active at the same time. The backend received conflicting query parameters, resulting in unpredictable results. I solved this by restructuring the query building logic to validate each parameter individually before applying it to the MongoDB query. This greatly improved both the stability and scalability of the filtering system.
Filtering and Sorting

Course Outcomes Demonstrated
This enhancement supports course outcome 3 by applying algorithmic thinking to improve data filtering, sorting, and searching. It also supports course outcome 4 by applying professional tools like MongoDB, Spring Boot, and Angular to create a modern, efficient, and scalable system.