Search Interview Questions  More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. 

 
Algorithm  Interview Questions and Answers for 'Complexity'  2 question(s) found  Order By Newest  
_{}
 
^{This question is still unanswered. Can you please provide an answer.}  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve Data Stricture Big O Notation time complexityCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Related Questions  
What is the Big O notation for Fibonacci series  both iterative as well as recursive ?  
_{}
 
Ans. Create one extra field called MAX O(1) when you an element to the stack check these two condition 1. Stack is empty, then MAX = element 2. Stack is not empty then check if the element is greater than MAX then MAX = element when getMax fuction is called, then return MAX  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve complexity stack data structure Asked in 1 CompaniesCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Related Questions  
What will happen if we don't have termination statement in recursion ?  
Why two types of memory  stack and heap are required by Java ?  
Why do member variables have default values whereas local variables don't have any default value ?  
Which memory areas does instance and static variables use ?  
Which kind of memory is used for storing object member variables and function local variables ?  
Difference between Stack and Heap memory ?  
Which type of memory is cleaned / recovered by garbage collection  stack or heap ?  
What will happen if we don't have termination statement in recursion ?  
Given a string and index for the opening bracket, find the index of matching closing bracket.  
What is the difference between Stack and Queue ?  