Can someone please suggest me a psuedo code to extract sub problems from an arithmetic expression:
For example,
How do I remove (8*2) and (3+2) from a given string (5 + 6(3+2) - 2(8*2) +1)
Input string will always start and end with paranthesis and the sub problems must be extracted as strings too.
string[] extract(string s1)
{
string extracted[];
if (s1[1]==')' )
cout<<"no expression"
return NULL
else
??????????
Return extracted[]