mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 20:44:39 +08:00
style: enable HideUtilityClassConstructor
in checkstyle (#5147)
This commit is contained in:
@ -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
|
||||
|
@ -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");
|
||||
|
@ -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<>();
|
||||
|
@ -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"));
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user