hello friends, given an expression we have to remove the
unwanted brackets in that expression.
Eg : (a+b) ---> a+b
(a+b)*(c)-----> (a+b)*c. Please mail me if you know
the logic. My mail id is : saravana6m@gmail.com.
Thank you in advance :-)
Answer Posted / arjun
hello there,
the logic i quite simple and such questions are give just to
confuse us.
push the given string in a stack and while popping out
ignore the bracket PAIR which contain
i) a lone variable in between
ii) does not contain any operator before or after the bracket.
for eg. if (a+b)*c is there then bracket must not be ignored.
thanks
Is This Answer Correct ? | 9 Yes | 14 No |
Post New Answer View All Answers
How can I Draw an ellipse in 3d space and color it by using graph3d?
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
how to diplay a external image of output on winxp by using c & c++,
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
How to swap two ASCII numbers?
output for printf("printf");
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
Code for Method of Handling Factorials of Any Size?
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?