Parenthesis are never needed in prefix or postfix
expressions. Why?

Answers were Sorted based on User's Feedback



Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / jayanth

Basically Parenthesis indicate the operations which
need to be carried out first ie according to the
BODMAS rule..SO in case of postfix or prefix expression
they are actualy conversions of the orginal standard
equation.Where the brackets have already been taken
into consideration,,,and the formed prefix/postfix
expression is the correct order of expansion of a given
mathematical statement..

Is This Answer Correct ?    148 Yes 10 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / arnoldindia

Evaluation of postfix or prefix notations are done with the
help of stacks. So there is no need for brackets.

In other words, infix notation is human-readable format,
which need brackets based on BODMAS rule to understand the
order of execution. The postfix or prefix are
machine-readable format. The conversion and evaluation of
postfix and prefix are applications of stack model.

Is This Answer Correct ?    46 Yes 7 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / poonam khandar

Parenthesis are used to define the sequence or priority of
execution of operations in given infix expression. When we
write an espression in prefix or postfix format we have
already considered the order of execution and only evaluate
the expression starting from left towars right in the
sequence the operators and operands are encountered.

Is This Answer Correct ?    34 Yes 3 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / triveni

Parenthises are never needed in prefix or postfix
expression because ---it is a carried according to the
BODMAS( it is a mathmatical operation order short rule to
solve brackets) rule by removing brackets. In case of
postfix or prefix expression, they are actually conversions
of the orginal standard equation, where the brackets have
already been taken into consideration, expression is the
correct order of expansion of a given mathematical
statement..

Is This Answer Correct ?    15 Yes 0 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / mithilesh kumar

Parenthesis are used to define the sequence or priority of
execution of operations which is useful in infix notation.
Whereas we have already taken
the consideration of order of execution of operands during
the time of conversion to
prefix or postfix form.These orders are maintained with
the help of Stack
i.e. Last in First out. So we donot need parenthesis in
prefix and postfix notions.

Is This Answer Correct ?    14 Yes 3 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / kenil

Because there is not an "order of operations" in prefix or postfix notation. The order in which you put the numbers and operators is the order in which calculation occurs.

Is This Answer Correct ?    3 Yes 0 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / hussain

Simple logic that ----
operators are not in between operands, in prefix and postfix expression, hence parentheses are not required in pre and postfix expression..

Is This Answer Correct ?    1 Yes 1 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / argha

In case of infix expression, the entry point of the
execution can be either left or right (forget about operator
priority).
Evaluate 2+3*5 from left, it is 30; from right, it is 17.
Convert it to postfix, 235*+, no confusion about the entry
point (and the answer which is 30). If we made it mandatory
for infix expression also that the entry point of evaluation
will be from left, there will not be any need for
parentheses. 2+3*5 will always be 30, to make it 17 write it
as 3*5+2 (in postfix).
Unfortunately, this rule for infix expression is not
mandated when first human mathematicians started thinking
(in early days of civilization). And alas, no common man
will accept this rule if I go to thrust it upon them. So we
have to live with parentheses in infix, and thankfully, none
in prefix or postfix. Machines are more logical being than
human. Agree?In case of infix expression, the entry point of the
execution can be either left or right (forget about operator
priority).
Evaluate 2+3*5 from left, it is 30; from right, it is 17.
Convert it to postfix, 235*+, no confusion about the entry
point (and the answer which is 30). If we made it mandatory
for infix expression also that the entry point of evaluation
will be from left, there will not be any need for
parentheses. 2+3*5 will always be 30, to make it 17 write it
as 3*5+2 (in postfix).
Unfortunately, this rule for infix expression is not
mandated when first human mathematicians started thinking
(in early days of civilization). And alas, no common man
will accept this rule if I go to thrust it upon them. So we
have to live with parentheses in infix, and thankfully, none
in prefix or postfix. Machines are more logical being than
human. Agree?In case of infix expression, the entry point of the
execution can be either left or right (forget about operator
priority).
Evaluate 2+3*5 from left, it is 30; from right, it is 17.
Convert it to postfix, 235*+, no confusion about the entry
point (and the answer which is 30). If we made it mandatory
for infix expression also that the entry point of evaluation
will be from left, there will not be any need for
parentheses. 2+3*5 will always be 30, to make it 17 write it
as 3*5+2 (in postfix).
Unfortunately, this rule for infix expression is not
mandated when first human mathematicians started thinking
(in early days of civilization). And alas, no common man
will accept this rule if I go to thrust it upon them. So we
have to live with parentheses in infix, and thankfully, none
in prefix or postfix. Machines are more logical being than
human. Agree?In case of infix expression, the entry point of the
execution can be either left or right (forget about operator
priority).
Evaluate 2+3*5 from left, it is 30; from right, it is 17.
Convert it to postfix, 235*+, no confusion about the entry
point (and the answer which is 30). If we made it mandatory
for infix expression also that the entry point of evaluation
will be from left, there will not be any need for
parentheses. 2+3*5 will always be 30, to make it 17 write it
as 3*5+2 (in postfix).
Unfortunately, this rule for infix expression is not
mandated when first human mathematicians started thinking
(in early days of civilization). And alas, no common man
will accept this rule if I go to thrust it upon them. So we
have to live with parentheses in infix, and thankfully, none
in prefix or postfix. Machines are more logical being than
human. Agree?

Is This Answer Correct ?    1 Yes 3 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / karthik

Because there is not an "order of operations" in prefix or
postfix notation. The order in which you put the numbers and
operators is the order in which calculation occurs.

Is This Answer Correct ?    5 Yes 8 No

Parenthesis are never needed in prefix or postfix expressions. Why?..

Answer / soumya kanti

In case of infix expression, the entry point of the
execution can be either left or right (forget about operator
priority).
Evaluate 2+3*5 from left, it is 30; from right, it is 17.
Convert it to postfix, 235*+, no confusion about the entry
point (and the answer which is 30). If we made it mandatory
for infix expression also that the entry point of evaluation
will be from left, there will not be any need for
parentheses. 2+3*5 will always be 30, to make it 17 write it
as 3*5+2 (in postfix).
Unfortunately, this rule for infix expression is not
mandated when first human mathematicians started thinking
(in early days of civilization). And alas, no common man
will accept this rule if I go to thrust it upon them. So we
have to live with parentheses in infix, and thankfully, none
in prefix or postfix. Machines are more logical being than
human. Agree?

Is This Answer Correct ?    8 Yes 12 No

Post New Answer

More Data Structures Interview Questions

State the advantages of using postfix notations?

0 Answers  


What are the Advantages and disadvantages of Array?

0 Answers  


What do you know about the big-o notation and can you give some examples with respect to different data structures?

0 Answers  


What is a queue in data structure?

0 Answers  


What is linked list with example?

0 Answers  






What is modcount in hashmap?

0 Answers  


Which type of memory allocation is referred for linked list?

0 Answers  


Why is arraylist used?

0 Answers  


What are the applications of stack?

0 Answers  


Now you are given an array of a characters (both ASCII and Kanji) and, an index into the array. The index points to the start of some character. Now you need to write a function to do a backspace (i.e. delete the character before the given index).

0 Answers  


Why do we Use a Multidimensional Array?

0 Answers  


Can you please explain the difference between string and an array?

0 Answers  


Categories