divorced-coders / divorce-analysis-frontend

MIT License
0 stars 0 forks source link

Rohin's Review #4

Open rohinsood opened 7 months ago

rohinsood commented 7 months ago

Video

Crossover Score Runtime Plan Github Analytics
.83 Link Link On individual tickets
Name Team+Indi+Teacher Runtime Key Commit(s) Analytics
Rohin S .83+.85+X Fibonacci & BubbleSort Fibonacci Via Memo & Recursion
Bubble Sort via Recursion
Backend Commits
Frontend Commits
Profile

Features

Fibonacci

Inheritance

public abstract class Fibo {
  public abstract int fibonacci(int n);
}
public class FibonacciViaRecursion extends Fibo {

  @Override
  public int fibonacci(int n) {
    if (n <= 1) {
      return n;
    } else {
      return fibonacci(n - 1) + fibonacci(n - 2);
    }
  }

  public static void main(String[] args) {
    Fibo fibo = new FibonacciViaMemoization();
    int n = 4;
    int result = fibo.fibonacci(n);
    System.out.println(result);
  }

}
public class FibonacciViaMemoization extends Fibo {

    private static Map<Integer, Integer> memo = new HashMap<>();

    @Override
    public int fibonacci(int n) {
        if (n <= 1) {
            return n;
        }

        if (memo.containsKey(n)) {
            return memo.get(n);
        }

        int result = fibonacci(n - 1) + fibonacci(n - 2);

        memo.put(n, result);

        return result;
    }
    public static void main(String[] args) {
        Fibo fibo = new FibonacciViaMemoization();
        int n = 4;
        int result = fibo.fibonacci(n);
        System.out.println(result);
    }
}

MonthlyStocks Sorting

Inheritance

package com.nighthawk.spring_portfolio.mvc.stocks.sorting;

import java.util.List;

import org.springframework.util.StopWatch;

import com.nighthawk.spring_portfolio.mvc.stocks.MonthlyStocks;

public class MonthlyStocksSorter {

    StopWatch sw = new StopWatch();
    int comparisons;

    public SortedData bubbleSort(List<MonthlyStocks> monthlyStocksList) {
        return null;
    }

    public SortedData selectionSort(List<MonthlyStocks> monthlyStocksList) {
        return null;
    }

    public int compareStrings(String str1, String str2) {
        this.comparisons++;
        try {
            double value1 = Double.parseDouble(str1);
            double value2 = Double.parseDouble(str2);
            return Double.compare(value1, value2);
        } catch (NumberFormatException e) {
            // Handle parsing errors or decide how to compare non-numeric strings
            return str1.compareTo(str2);
        }
    }
}
package com.nighthawk.spring_portfolio.mvc.stocks.sorting;

import java.util.List;

import com.nighthawk.spring_portfolio.mvc.stocks.MonthlyStocks;

public class Ascending extends MonthlyStocksSorter {

  public SortedData recursiveBubbleSort(List<MonthlyStocks> monthlyStocksList, int n) {
    boolean swapped = false;

    super.sw.start();
    for (int i = 1; i < n; i++) {
        if (super.compareStrings(monthlyStocksList.get(i - 1).getHigh(), monthlyStocksList.get(i).getHigh()) > 0) {
            // Swap elements
            MonthlyStocks temp = monthlyStocksList.get(i - 1);
            monthlyStocksList.set(i - 1, monthlyStocksList.get(i));
            monthlyStocksList.set(i, temp);
            swapped = true;
        }
    }
    super.sw.stop();

    if (!swapped || n == 1) {
        return new SortedData(super.comparisons, super.sw.getTotalTimeMillis(), monthlyStocksList);
    } else {
        return recursiveBubbleSort(monthlyStocksList, n - 1);
    }
}

}

Overall Reflection

PaarasPurohit commented 7 months ago

Individual Review "My name" grading "Their name"

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

Something I liked was how communication with other team members ran smoothly. The frontend, backend, and connection ran smoothly and I liked how the collaboration was run to produce a project of good quality. Something that could've been improved on, in retrospect, would be more focus on algorithm analysis. I didn't see a lot of Big O Notation presented in the ticket or the project. Overall, the score averages 0.85 out of 0.9. Good job!