Skip to content

Commit 670f5e3

Browse files
committed
Style: Auto-format Java files to fix linter issues
1 parent 4192550 commit 670f5e3

2 files changed

Lines changed: 18 additions & 15 deletions

File tree

src/main/java/com/thealgorithms/dynamicprogramming/LongestArithmeticSubsequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.HashMap;
44

5-
@SuppressWarnings({"rawtypes", "unchecked"})
5+
@SuppressWarnings({ "rawtypes", "unchecked" })
66
final class LongestArithmeticSubsequence {
77
private LongestArithmeticSubsequence() {
88
}

src/main/java/com/thealgorithms/stacks/StackPostfixNotation.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77
/**
88
* Utility class for evaluating postfix expressions using integer arithmetic.
99
* <p>
10-
* Postfix notation, also known as Reverse Polish Notation (RPN), is a mathematical notation in which operators follow their operands.
11-
* This class provides a method to evaluate expressions written in postfix notation.
10+
* Postfix notation, also known as Reverse Polish Notation (RPN), is a
11+
* mathematical notation in which operators follow their operands.
12+
* This class provides a method to evaluate expressions written in postfix
13+
* notation.
1214
* </p>
1315
* <p>
1416
* For more information on postfix notation, refer to
15-
* <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse Polish Notation (RPN) on Wikipedia</a>.
17+
* <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse
18+
* Polish Notation (RPN) on Wikipedia</a>.
1619
* </p>
1720
*/
1821
public final class StackPostfixNotation {
@@ -22,16 +25,16 @@ private StackPostfixNotation() {
2225
private static BiFunction<Integer, Integer, Integer> getOperator(final String operationSymbol) {
2326
// note the order of operands
2427
switch (operationSymbol) {
25-
case "+":
26-
return (a, b) -> b + a;
27-
case "-":
28-
return (a, b) -> b - a;
29-
case "*":
30-
return (a, b) -> b * a;
31-
case "/":
32-
return (a, b) -> b / a;
33-
default:
34-
throw new IllegalArgumentException("exp contains an unknown operation.");
28+
case "+":
29+
return (a, b) -> b + a;
30+
case "-":
31+
return (a, b) -> b - a;
32+
case "*":
33+
return (a, b) -> b * a;
34+
case "/":
35+
return (a, b) -> b / a;
36+
default:
37+
throw new IllegalArgumentException("exp contains an unknown operation.");
3538
}
3639
}
3740

@@ -77,4 +80,4 @@ public static int postfixEvaluate(final String exp) {
7780
throw new IllegalArgumentException("exp is not a proper postfix expression.");
7881
}
7982
return s.pop(); }
80-
}
83+
} ̰

0 commit comments

Comments
 (0)