- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.js
More file actions
Latest commit
20 lines (19 loc) · 551 Bytes
/
Copy pathexample.js
File metadata and controls
20 lines (19 loc) · 551 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
constconvert_infix_to_postfix=require('./Infix2Postfix.js');
// Example
console.log(convert_infix_to_postfix("5 + 6 * 7"));
// [ '5', '6', '7', '*', '+' ]
console.log(convert_infix_to_postfix("(((a/b)-c) + (d*e))- (a*c)"));
// [
// 'a', 'b', '/', 'c',
// '-', 'd', 'e', '*',
// '+', 'a', 'c', '*',
// '-'
// ]
console.log(convert_infix_to_postfix("(k+l)-(m*n)+(o^p)*w/v/u*t+q"));
// [
// 'k', 'l', '+', 'm', 'n',
// '*', '-', 'o', 'p', '^',
// 'w', '*', 'v', '/', 'u',
// '/', 't', '*', '+', 'q',
// '+'
// ]