style: enable HideUtilityClassConstructor in checkstyle (#5147)

This commit is contained in:
Piotr Idzik
2024-05-08 08:58:29 +02:00
committed by GitHub
parent 030bb91d05
commit d3bb691f59
285 changed files with 895 additions and 339 deletions

View File

@ -16,7 +16,9 @@ import java.util.Stack;
* @author <a href="https://github.com/khalil2535">khalil2535<a>
* @author shellhub
*/
class BalancedBrackets {
final class BalancedBrackets {
private BalancedBrackets() {
}
/**
* Check if {@code leftBracket} and {@code rightBracket} is paired or not

View File

@ -2,7 +2,9 @@ package com.thealgorithms.stacks;
import java.util.Stack;
public class DecimalToAnyUsingStack {
public final class DecimalToAnyUsingStack {
private DecimalToAnyUsingStack() {
}
public static void main(String[] args) {
assert convert(0, 2).equals("0");

View File

@ -11,7 +11,9 @@ package com.thealgorithms.stacks;
import java.util.Scanner;
import java.util.Stack;
public class DuplicateBrackets {
public final class DuplicateBrackets {
private DuplicateBrackets() {
}
public static boolean check(String str) {
Stack<Character> st = new Stack<>();

View File

@ -2,7 +2,9 @@ package com.thealgorithms.stacks;
import java.util.Stack;
public class InfixToPostfix {
public final class InfixToPostfix {
private InfixToPostfix() {
}
public static void main(String[] args) throws Exception {
assert "32+".equals(infix2PostFix("3+2"));

View File

@ -7,7 +7,9 @@ import java.util.Stack;
* @author mohd rameez github.com/rameez471
*/
public class LargestRectangle {
public final class LargestRectangle {
private LargestRectangle() {
}
public static String largestRectanglehistogram(int[] heights) {
int n = heights.length, maxArea = 0;

View File

@ -27,7 +27,9 @@ import java.util.Stack;
*
* @author sahil
*/
public class MaximumMinimumWindow {
public final class MaximumMinimumWindow {
private MaximumMinimumWindow() {
}
/**
* This function contains the logic of finding maximum of minimum for every

View File

@ -41,7 +41,9 @@ import java.util.Stack;
-1.
*/
public class NextGreaterElement {
public final class NextGreaterElement {
private NextGreaterElement() {
}
public static int[] findNextGreaterElements(int[] array) {
if (array == null) {

View File

@ -37,7 +37,9 @@ import java.util.Stack;
answer is -1
*/
public class NextSmallerElement {
public final class NextSmallerElement {
private NextSmallerElement() {
}
public static int[] findNextSmallerElements(int[] array) {
// base case

View File

@ -16,7 +16,9 @@ import java.util.Stack;
*
*/
public class PostfixToInfix {
public final class PostfixToInfix {
private PostfixToInfix() {
}
public static boolean isOperator(char token) {
switch (token) {