Skip to content

Commit 0e12d9d

Browse files
committed
move example from infix.js file and add module.exports
1 parent bcb3ebe commit 0e12d9d

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

Infix2Postfix.js

+1-18
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,4 @@ const convert_infix_to_postfix = (infix) => {
7878
return postfix;
7979
};
8080

81-
// Example
82-
console.log(convert_infix_to_postfix("5 + 6 * 7"));
83-
// [ '5', '6', '7', '*', '+' ]
84-
console.log(convert_infix_to_postfix("(((a/b)-c) + (d*e))- (a*c)"));
85-
// [
86-
// 'a', 'b', '/', 'c',
87-
// '-', 'd', 'e', '*',
88-
// '+', 'a', 'c', '*',
89-
// '-'
90-
// ]
91-
console.log(convert_infix_to_postfix("(k+l)-(m*n)+(o^p)*w/v/u*t+q"));
92-
// [
93-
// 'k', 'l', '+', 'm', 'n',
94-
// '*', '-', 'o', 'p', '^',
95-
// 'w', '*', 'v', '/', 'u',
96-
// '/', 't', '*', '+', 'q',
97-
// '+'
98-
// ]
81+
module.exports = convert_infix_to_postfix;

0 commit comments

Comments
 (0)