Skip to content

Commit 05fd2f9

Browse files
add docs (examplehub#41)
1 parent 3ef84af commit 05fd2f9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/examplehub/datastructures/stack/Infix2Postfix.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
import java.util.Stack;
44

55
public class Infix2Postfix {
6+
7+
/**
8+
* Convert infix to postfix.
9+
*
10+
* @param infixExpression the infix expression.
11+
* @return postfix expression.
12+
* @throws Exception if infix expression is invalid.
13+
*/
614
public static String infix2PostFix(String infixExpression) throws Exception {
715
if (!BalancedParentheses.isBalanced(infixExpression)) {
816
throw new Exception("invalid expression");

0 commit comments

Comments
 (0)