Remove brackets from an algebraic string containing + and – operators

Problem Statement You are given a string s of size n representing an arithmetic expression with parenthesis. The problem “Remove brackets from an algebraic string containing + and – operators” asks us to create a function that can simplify the given expression. Example s = “a-(b+c)” a-b-c  s = a-(b-c-(d+e))-f a-b+c+d+e-f …

Read more

Implement Stack and Queue using Deque

Problem Statement The problem “Implement Stack and Queue using Deque” states to write an algorithm to implement Stack and Queue using a Deque(Doubly Ended Queue). Example (Stack) Push(1) Push(2) Push(3) Pop() isEmpty() Pop() Size() 3 false 2 1 Example (Queue) Enqueue(1) Enqueue(2) Enqueue(3) Dequeue isEmpty() Size() Dequeue() 1 false 2 …

Read more

Translate »