Technical Discussion :: Data Structure
Home > Freshers > Technical Interview Questions > Data Structure
40. Write the postfix form of the following expression .
A+[[(B+C)+(D+E)*F]/G]
Answer:
(a b) * (c*d-e) * f / g
Priority to ‘/‘ operator
(a b) * (c*d-e) * fg/
Priority to brackets and ‘*’ operator
(a b)(c*d-e)fg/**
Priority to ‘*’ operator
(a b)(cd*-e)fg/**
Priority to ‘ ’ and ‘-’ operators
(ab )(cd*e-)fg/**
Asked In :: Cisco Sopra Steria
(a b) * (c*d-e) * f / g
Priority to ‘/‘ operator
(a b) * (c*d-e) * fg/
Priority to brackets and ‘*’ operator
(a b)(c*d-e)fg/**
Priority to ‘*’ operator
(a b)(cd*-e)fg/**
Priority to ‘ ’ and ‘-’ operators
(ab )(cd*e-)fg/**
Priority to ‘/‘ operator
(a b) * (c*d-e) * fg/
Priority to brackets and ‘*’ operator
(a b)(c*d-e)fg/**
Priority to ‘*’ operator
(a b)(cd*-e)fg/**
Priority to ‘ ’ and ‘-’ operators
(ab )(cd*e-)fg/**