you really know how to teach... honestly its a rare thing to find someone thats actually good at teaching. People think a teacher needs to master the subject, thats kinda true.... BUT! a teacher that masters teaching and understands a subject at a basic level is far superior than the teacher that masters the subject but is mediocre at teaching.
Thank you very much for the kind comment, Shady. In teaching others, I truly believe that the delivery of knowledge is equally important to knowledge itself.
Hi CyberData World (I'm assuming you're talking about an algorithmic way and not something like java deep copy), so one way you can do this is to create getters and setters for the size and top instance variables (since they are private and can't be accessed outside the Stack class, unless ofc you remove the private modifier). You can then create 2 other stacks objects. In all you'll have 3 stacks. We can call them original, intermediate, and destination respectively. You can then push the integer values from the original stack to the intermediate stack using the push method. Then from the intermediate stack to the destination stack. This way you can preserve the order of the elements in the original stack. That's one way you can think about it. Hope this helps :)
Hey Everyone! Thanks for checking out my video! Don't forget to Like, Subscribe, and MOST IMPORTANTLY click that Notification Bell for updates! :)
This channel is ridiculously underrated. Clear explanations, perfect pace, coherent structure, ideal visuals. Please keep making content!
Thanks for the kind comment, Barack Obama! :)
After watching multiple videos on this topic this is the best and stands out
Thank you so much, Chetan!
Subscribed!! Your videos are incredibly helpful, please please keep it on!!
Thanks a lot! Glad they help! :)
you really know how to teach... honestly its a rare thing to find someone thats actually good at teaching. People think a teacher needs to master the subject, thats kinda true.... BUT! a teacher that masters teaching and understands a subject at a basic level is far superior than the teacher that masters the subject but is mediocre at teaching.
Thank you very much for the kind comment, Shady. In teaching others, I truly believe that the delivery of knowledge is equally important to knowledge itself.
Amazing videos, Keep it up buddy!
@MUHAMMAD HAMZA SAJJAD Thanks for the kind comment! :)
your the best please keep up the good work
Thank you!! Please don't forget to share the channel as it will help it to grow.
great work
Thank you, Avineet!
Amazing videos. It helped me out a lot!
@Leonardo Muñoz, glad it helped :)
Please can u make videos explaining python code on these topics?
Hi! How can I clone a stack using this implementation? Thanks!
Hi CyberData World (I'm assuming you're talking about an algorithmic way and not something like java deep copy), so one way you can do this is to create getters and setters for the size and top instance variables (since they are private and can't be accessed outside the Stack class, unless ofc you remove the private modifier). You can then create 2 other stacks objects. In all you'll have 3 stacks. We can call them original, intermediate, and destination respectively. You can then push the integer values from the original stack to the intermediate stack using the push method. Then from the intermediate stack to the destination stack. This way you can preserve the order of the elements in the original stack. That's one way you can think about it. Hope this helps :)
@@BlueTreeCode Hi! Yes I did it using that method! Thank you!!
I try your program with mine and I have leak in my void pop. (in my program it is void not int)
Hi Nicolas, the return type wouldn't cause an issue. Can you define what you mean by 'leak' as well as share your code? Thanks.
@@BlueTreeCode i resolve my problem
Please can u make videos explaining python code on these topics?