Extend Stack datastructure class which we had build in Lecture to implement following Functionalities: 1- Extend the
Question:
Extend Stack datastructure class which we had build in Lecture to implement following Functionalities: 1- Extend the Stack class and add a new method to return the largest number. What is the runtime complexity of this method? 2- Extend the Stack class and add a method to return the common items. What is the runtime complexity of this method? 3- Extend the Stack class and add a method to return the product of Stack. What is the runtime complexity of this method? 4 - Extend the Stack class and add a method to return the average of Stack . What is the runtime complexity of this method? 5 - Extend the Stack class and add a method to return the reverse of Stack. What is the runtime complexity of this method? 6 - Extend the Stack class and add a method to return the distinct numbers of Stack. What is the runtime complexity of this method? 7 - Extend the Stack class and add a method to Replace any number from Stack. What is the runtime complexity of this method? 8 - Extend the Stack class and add a method to return Even Numbers from Stack . What is the runtime complexity of this method? 9 - Extend the Stack class and add a method to return ODD Numbers from Stack . What is the runtime complexity of this method? 10 - Extend the Stack class and add a method to return Prime Numbers from Stack. What is the runtime complexity of this method? 11 - Extend the Stack class and add a method to calculate Factorial of Number Using Stack. What is the runtime complexity of this method? 12 - Extend the Stack class and add a method calculate Power of Number. What is the runtime complexity of this method? 13 - Extend the Stack class and add a method Replace Top Value From Stack. What is the runtime complexity of this method?
In Java
Introduction To Java Programming And Data Structures Comprehensive Version
ISBN: 9780136520238
12th Edition
Authors: Y. Daniel Liang