This is the main public class that I used for the 4 sorting methods to "inherit". I needed them all to follow the same structure with an array, startTime, and endTime
As you can see with my SelectionSort.java file, it inherits the main Sort.java file and its attributes. The only difference between the SelectionSort.java, InsertionSort.java, MergeSort.java, and BubbleSort.java files are the sorting algorithms that define the sorting type to which they are called
API Controller
Basically, what I did was configure each sorting algorithm to a specific endpoint. In the frontend, when the use selects the button for the algorithm they want to call, it changes the backend fetch link to the specified endpoint. The returns/responses are the same, just tailored to what specific sort the user is calling on
Response
The final aspect is the response file. You can see the setters and getters for the sorted array and sort time. These are the two things that eventually get returned into the frontend.
Inheritance
This is the main public class that I used for the 4 sorting methods to "inherit". I needed them all to follow the same structure with an array, startTime, and endTime
As you can see with my SelectionSort.java file, it inherits the main Sort.java file and its attributes. The only difference between the SelectionSort.java, InsertionSort.java, MergeSort.java, and BubbleSort.java files are the sorting algorithms that define the sorting type to which they are called
API Controller
Basically, what I did was configure each sorting algorithm to a specific endpoint. In the frontend, when the use selects the button for the algorithm they want to call, it changes the backend fetch link to the specified endpoint. The returns/responses are the same, just tailored to what specific sort the user is calling on
Response
The final aspect is the response file. You can see the setters and getters for the sorted array and sort time. These are the two things that eventually get returned into the frontend.