Stack Based

Problem Data Structure Used Time Complexity
Converison of an Infix expression to Postfix expression Stack O ( N ). ‘N’ is the number of tokens in the infix expression.
Evaluation of an Infix expression Stack O ( N ). ‘N’ is the number of tokens in the infix expression.
Finding largest rectangle in histogram Stack O ( N ). ‘N’ is the number of bars/buildings in the histogram.
Finding the stock span Stack O ( N ). ‘N’ is the number days with listed stock prices.


Copyright (c) 2019-2021, Algotree.org.
All rights reserved.