Parenthesis are never needed in prefix or postfix
expressions. Why?
Answers were Sorted based on User's Feedback
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 ? | 149 Yes | 10 No |
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 ? | 47 Yes | 7 No |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is hashing technique? Describe in brief.
what is binary tree?
Can we extend an array after initialization?
How to get the index of an array element?
What are the benefits of using arrays?
What is the slowest sorting algorithm?
Check if duplicates exist in an array of N which has range 1 to N.
What is queue example?
Does treemap allow null key?
What is data structure and data type?
What is meant by balanced binary tree?
do records fall under linear or non linear data structures?