SortingMiniProject / frontend

https://sortingminiproject.github.io/frontend/
Apache License 2.0
0 stars 0 forks source link

Mini Sort Project Crossover Review Ticket #4

Open yuricoder07 opened 10 months ago

yuricoder07 commented 10 months ago

Team

Crossover Score Runtime Write up GitHub Comment Analytics
0.8 Frontend Runtime Write up is below Frontend, Backend frontend commits, backend commits

Individuals

Name Grade Key Commits Analytics Video Individual Ticket
Yuri Grade: 1.68 Inheritance Integration,Cors Issue Cleanup analytics video Link
Vinay Grade: 1.65 Cors Fix, Fibonacci Integration analytics Video Link
Edwin Grade: 1.5625 CSS Implementation, Song Public Class Analytics Video Link

Project Outline

Our project utilizes a JSON database of 147,400 cities across the world and sorts them based on length while outputting the complexity in which it took to sort. The Fibonacci portion of our project finds the fibonacci sequence using four different functions (For, While, Recursive, Stream).

Sorting Algorithm and Logistics

Yuri primarily worked on the sorting algorithms integrating inheritance into the sorting portion of the project. The four algorithms we used for our project were : bubble, sort, selection and merge.

Inheritance

Below is an example on how Yuri used inheritance (we have a parent class that extends to all the algorithms we created)

package com.nighthawk.spring_portfolio.mvc.cities;
package com.nighthawk.spring_portfolio.mvc.cities;
import java.util.ArrayList;
import java.util.List;

// Abstract base class
abstract class SortingAlgorithms {
    public abstract List<String> sort(List<String> data);
}

Bubble Sort

class BubbleSort extends SortingAlgorithms {
    @Override
    public List<String> sort(List<String> data) {
        int n = data.size();
        for (int i = 0; i < n - 1; i++) {
            for (int j = 0; j < n - i - 1; j++) {
                if (data.get(j).length() > data.get(j + 1).length()) {
                    String temp = data.get(j);
                    data.set(j, data.get(j + 1));
                    data.set(j + 1, temp);
                }
            }
        }
        return data;
    }
}

Insertion sort

// Insertion Sort implementation
class InsertionSort extends SortingAlgorithms {
    @Override
    public List<String> sort(List<String> data) {
        for (int i = 1; i < data.size(); i++) {
            String key = data.get(i);
            int j = i - 1;

            while (j >= 0 && data.get(j).length() > key.length()) {
                data.set(j + 1, data.get(j));
                j = j - 1;
            }
            data.set(j + 1, key);
        }
        return data;
    }
}

Merge Sort

// Merge Sort implementation
class MergeSort extends SortingAlgorithms {
    @Override
    public List<String> sort(List<String> data) {
        if (data.size() <= 1) {
            return data;
        }

        int mid = data.size() / 2;
        List<String> left = new ArrayList<>(data.subList(0, mid));
        List<String> right = new ArrayList<>(data.subList(mid, data.size()));

        return merge(mergeSort(left), mergeSort(right));
    }

    private List<String> merge(List<String> left, List<String> right) {
        List<String> result = new ArrayList<>();
        int leftIndex = 0, rightIndex = 0;

        while (leftIndex < left.size() && rightIndex < right.size()) {
            if (left.get(leftIndex).length() <= right.get(rightIndex).length()) {
                result.add(left.get(leftIndex++));
            } else {
                result.add(right.get(rightIndex++));
            }
        }

        result.addAll(left.subList(leftIndex, left.size()));
        result.addAll(right.subList(rightIndex, right.size()));

        return result;
    }

    private List<String> mergeSort(List<String> data) {
        if (data.size() <= 1) {
            return data;
        }

        int mid = data.size() / 2;
        List<String> left = new ArrayList<>(data.subList(0, mid));
        List<String> right = new ArrayList<>(data.subList(mid, data.size()));

        return merge(mergeSort(left), mergeSort(right));
    }
}

Selection Sort

// Selection Sort implementation
class SelectionSort extends SortingAlgorithms {
    @Override
    public List<String> sort(List<String> data) {
        for (int i = 0; i < data.size() - 1; i++) {
            int minIdx = i;
            for (int j = i + 1; j < data.size(); j++) {
                if (data.get(j).length() < data.get(minIdx).length()) {
                    minIdx = j;
                }
            }

            String temp = data.get(minIdx);
            data.set(minIdx, data.get(i));
            data.set(i, temp);
        }
        return data;
    }
}

Fibonacci Code

Vinay worked on the Fibonacci part of our Project. Our fibonacci code also used inheritance. This is our parent class: image

Each method for calculating the fibonacci sequence extends this parent class, and adds its own methods. For: image

While: image

Recursive: image image

Stream: image

Our frontend

Edwin was our main frontend developer. This is the frontend for our fibonacci project. We chose to keep it simple and easy to understand to improve our user's experience. image This is our frontend for the sorting project, designed by Edwin. image image

Issues

We faced a few issues. Below are a few of them: Vinay:

  1. While integrating the frontend and backend, I ran into this error: image This error caused to not be able to use our api. I figured out that that the problem was that the @CrossOrigins was wrong, and I was able to fix it: image

Reflection

While working on this project, we learned a lot about the different types of sorts that we used. For example, we learned that merge sort is the fastest sort, while bubble sort is the slowest one. Because of our large dataset of cities, it was hard testing our data, since we had to wait several minutes for our data to be sorted. In the future, we will likely use a smaller data set to speed up the process of sorting the data, so it can be displayed in a timely manner. We also learned more about the agile development process. We want to focus more on the planning part of the process next time, since it was lacking for this project. However, the other parts of the process went well, and by following the process, we were able to successfully complete our project.

Yuri:

  1. During the project on first run-through I wrote the sorting methods without utilizing inheritance. At first it was very troubling integrating inheritance into the project, however after collaborating with Vinay and Edwin I managed to successfully add it.
akshat122805 commented 10 months ago

Individual Review "Akshat Parikh" grading "Yuri S."

Individuals Video, Issue(s), Commits(s)

Grader Notes:

Final Score: 0.78/0.9

tanayp327 commented 10 months ago

Individual Review "Tanay" grading "Vinay"

Individuals Video, Issue(s), Commits(s)

Vinay had all the things that he needed, showed that he had a good knowledge of how the code works. He had a lot of commits on both the frontend and backend. I would like to see a way that this team can properly display the other sorting methods than merge. I think they can break the database down so that sorting is faster, don't really need 147000 cities at once.

Toby-Leeder commented 9 months ago

Individual Review Toby Leeder grading Edwin Abraham

Individuals Video, Issue(s), Commits(s)

Average Score: 0.7625/.9 Comment: Edwin had all of the requirements for this project, except for evidence of continuous planning/issue making and updating ideation throughout the project. It was clear that he was an important part of the group, as I saw both frontend and backend commits. It appears that Edwin mostly was in charge of the frontend and designed the page. I will say that Edwins commits could have been improved, he committed large amounts of code at once rather than commuting small changes often. Edwin's video could have been a little better, it focused a little too much on a demonstration of his project rather than on the code he worked on. Overall it was clear that Edwin had valuable contributions to his team and worked hard throughout the mini project.