September 14, 2021#leetcodeQuestion Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Impl
Question: A Slice of an array said to be a Bounded slice if Max(SliceArray)-Min(SliceArray)<=K. If Array [3,5,6,7,3] and K=2 provided .. the number of bounded slice is 9, first slice (0,0) in the array Min(0,0)=3 Max(0,0)=3 Max-Min<=K result 0<=2 so it is ...
Question: Blocking queue related question often gets asked from Google, LinkedIn. For example, iImplement a fixed size blocking queue with the following defined functions. By blocking queue it Blocking queue related question often gets asked from Google, LinkedIn. means if the queue is empty, the...
Question: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. empty() -- Return whether the stack is empty. Notes: You must useonlystandard operations of ...