mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-20 18:24:49 +08:00
style: enable HideUtilityClassConstructor
in checkstyle (#5147)
This commit is contained in:
@ -6,7 +6,9 @@ import java.util.Comparator;
|
||||
|
||||
// Problem Link: https://en.wikipedia.org/wiki/Activity_selection_problem
|
||||
|
||||
public class ActivitySelection {
|
||||
public final class ActivitySelection {
|
||||
private ActivitySelection() {
|
||||
}
|
||||
// Function to perform activity selection
|
||||
public static ArrayList<Integer> activitySelection(int[] startTimes, int[] endTimes) {
|
||||
int n = startTimes.length;
|
||||
|
@ -6,7 +6,9 @@ import java.util.Comparator;
|
||||
|
||||
// Problem Link : https://en.wikipedia.org/wiki/Change-making_problem
|
||||
|
||||
public class CoinChange {
|
||||
public final class CoinChange {
|
||||
private CoinChange() {
|
||||
}
|
||||
// Function to solve the coin change problem
|
||||
public static ArrayList<Integer> coinChangeProblem(int amount) {
|
||||
// Define an array of coin denominations in descending order
|
||||
|
@ -5,7 +5,9 @@ import java.util.Comparator;
|
||||
|
||||
// Problem Link: https://en.wikipedia.org/wiki/Continuous_knapsack_problem
|
||||
|
||||
public class FractionalKnapsack {
|
||||
public final class FractionalKnapsack {
|
||||
private FractionalKnapsack() {
|
||||
}
|
||||
// Function to perform fractional knapsack
|
||||
public static int fractionalKnapsack(int[] weight, int[] value, int capacity) {
|
||||
// Create a 2D array to store item indices and their value-to-weight ratios.
|
||||
|
@ -5,7 +5,9 @@ import java.util.Arrays;
|
||||
|
||||
// Problem Link: https://en.wikipedia.org/wiki/Job-shop_scheduling
|
||||
|
||||
public class JobSequencing {
|
||||
public final class JobSequencing {
|
||||
private JobSequencing() {
|
||||
}
|
||||
|
||||
// Define a Job class that implements Comparable for sorting by profit in descending order
|
||||
static class Job implements Comparable<Job> {
|
||||
|
@ -2,7 +2,9 @@ package com.thealgorithms.greedyalgorithms;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class MinimizingLateness {
|
||||
public final class MinimizingLateness {
|
||||
private MinimizingLateness() {
|
||||
}
|
||||
|
||||
public static class Job {
|
||||
String jobName;
|
||||
|
Reference in New Issue
Block a user