dailycodebase

2 month data structures and algorithmic scripting challenge starting from 20th December 2018 - Coding is Fun! 💯💯 Do it everyday!! Also, Do give us a ⭐ if you liked the repository

View on GitHub

cover

Day 40 - Prerfix, Infix, Postfix Conversion

Infix Expression: The expression of the form a op b. When an operator is in-between every pair of operands.

Example: ( (A * B) + (C / D) )

Prefix Operation: An expression is called the prefix expression if the operator appears in the expression before the operands. Simply of the form (operator operand1 operand2)

Example: (+ (* A B) (/ C D) )

Postfix Expression: The expression of the form a b op. When an operator is followed for every pair of operands.

Example: ( (A B *) (C D /) +)

Question 1

Convert an Infix Expression to a Postfix Expression

Hint: https://www.geeksforgeeks.org/stack-set-2-infix-to-postfix/

Question 2

Convert an Infix Expression to a Prefix Expression

Hint: https://www.geeksforgeeks.org/infix-to-prefix-conversion-using-two-stacks/

Question 3

Convert an Postfix Expression to a Infix Expression

HINT: https://www.geeksforgeeks.org/postfix-to-infix/

Solution to Question 1

JavaScript Implementation

// To Be Added

Solution to Question 2

JavaScript Implementation

// To Be Added

Solution to Question 3

JavaScript Implementation

// To Be Added