sajit.kunnumkal
BAN USER
Comments (4)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
The example given is a linear equation in x, and if it is then its do-able I think. any higher power, I have no clue.
For this.
1. divide the LHS by x. you get an equation with only constants
2. Evaluate LHS using the 2 stacks as mentioned by Gitesh.
3 x = RHS / evaluated (LHS)
Comment hidden because of low score. Click to expand.
0
of 0 vote
But how will you calculate the result that you want to put again on the stack 2. coz this has the term x.
- sajit.kunnumkal February 18, 2013Comment hidden because of low score. Click to expand.
0
of 0 vote
Unless the two arrays are sorted, how can this be done in O(n)?
- sajit.kunnumkal January 08, 2012Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
True. Scan the string to isolate tokens with x and move any constants to RHS.. Still tricky.
- sajit.kunnumkal February 18, 2013