Convert following infix expression to the prefix expression.
a - b + c * (d / e - (f + g))
Answer Posted / naresh
first u need to reverse the given string like this..
))g+f(-e/d(*c+b-a..
after doing this, we need to consider a stack n insert symbolls into the stack whenever u encountered it in the string..
sequence of flow is:
g
f
+
e
d
/
-
c
*
b
+
a
-......
the string obtained is gf+ed/-c*b+a-..
u need to reverse the string for answer i.e
ans is -a+b*c-/de+fg..
| Is This Answer Correct ? | 28 Yes | 23 No |
Post New Answer View All Answers
If you are given a choice to use either arraylist and linkedlist, which one would you use and why?
Define binary tree insertion.
Which is faster hashmap or hashset?
Give a good data structure for having n queues ( n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.
Differentiate between the singly linked list and doubly linked list.
Define 2-3-4 tree?
an array of size N in which every number is between 1 and N, determine if there are any duplicates in it. You are allowed to destroy the array if you like. [ I ended up giving about 4 or 5 different solutions for this, each supposedly better than the others ].
What is int data type?
How does the size of arraylist increases dynamically?
Does linkedhashset allow duplicates?
How to pass in data structure exam?
What is height balanced tree?
What is list and types of list?
What is arrays copyof?
Can arraylist hold duplicates?