8000 Make clear that this is postfix · TheAlgorithms/JavaScript@409fbec · GitHub
[go: up one dir, main page]

Skip to content

Commit 409fbec

Browse files
authored
Make clear that this is postfix
1 parent 23034da commit 409fbec

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Data-Structures/Stack/EvaluateExpression.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**
2-
* Evaluate a numeric operations string using a stack.
2+
* Evaluate a numeric operations string in postfix notation using a stack.
33
* Supports basic arithmetic operations: +, -, *, /
44
* Literature reference: https://www.geeksforgeeks.org/evaluation-of-postfix-expression/
55
*
66
* @param {string} expression - Numeric operations expression to evaluate.
77
* @returns {number|null} - Result of the expression evaluation, or null if the expression is invalid.
88
*/
9-
function evaluateExpression(expression) {
9+
function evaluatePostfixExpression(expression) {
1010
const stack = [];
1111

1212
// Helper function to perform an operation and push the result to the stack
@@ -62,5 +62,5 @@ function evaluateExpression(expression) {
6262
}
6363
}
6464

65-
export { evaluateExpression };
66-
65+
export { evaluatePostfixExpression };
66+

0 commit comments

Comments
 (0)
0