Remove extra brackets
2010-09-25 16:43 wansishuang 阅读(168) 评论(0) 收藏 举报I have a expression containing extra brackets .Write an algo which can remove unwanted brackets like expression is (((a+d)*(a-2))) so we shuld be able to get (a+d)*(a-2)
One solution:
 
                    
                     
                    
                 
                    
                 
                
             浙公网安备 33010602011771号
浙公网安备 33010602011771号
Think it will be good to start with converting this to Hungarian notation (using recursion)
And then convert back to normal view with brackets