so first off I am having issues with passing the T value cause for some reason im getting errors saying it cant resolve identifiers for T data or even in my constructors(same issue in stack class)secondly I also have to implement a destructor where I threw the stack underflow. its suppose to loop until stack is empty which I figure I should use a while loop and call my pop function but I am not quite sure. and lastly I am not sure if I wrote my push algorithm correctly. I am still a novice so please be patient with me try and go easy on me, I can use all the help I can get. thank you for time and help!
Thank you for the reply and help! my node stack seems to be ok now. but the only thing is that I need that I need the top function this is the pseudo code that I need to implement so is there a way I can do it with the top function
T top()
1. If the stack is not empty
1.1. Set the result to the top node’s data
2. Else
2.1. Throw a stack underflow exception
3. End if
4. Return result