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


Please Help Members By Posting Answers For Below Questions

Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

4386


write a program that reads a series of strings and prints only those strings begging with letter "b"

2658


write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation

2387


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3255


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.

1961






how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1802


How can I Draw an ellipse in 3d space and color it by using graph3d?

2122


Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).

3182


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.

2058


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2206


write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

4294


A suduco given & u hv 2 check if it is incomplete(blanks left),or correct or incorrect

2391


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3254


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

2549


Code for Two Classes for Doing Gzip in Memory?

2801