📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time. #include #include using namespace std; void printStackElements(stack stack) { while (!stack.empty()) { cout
i like when u put all the code here not the code at the start :p it makes it easy to write it on my notepad with my pencil. It helps me remember stuff when needed.
Love how you give us a real application example of stack. If you could do more that it be great. Sometimes trying to see c++ in action in software is hard to find.
Hello from Syria Saldine All thanks to you for the useful lessons you offer, with simple explanations. I hope you continue with the lessons of data structures and not delay with the lessons. Thank you.
Something that I never thought of but I have thought of a good example of recursion which are taking a photo of yourself between two mirrors and screen recording/screenshotting your desktop through multiple windows.
I was having problems understanding stack memory in computer architecture course, and your explanation made everything clear. Thank you, really appreciate it.
Hello Saldina, Thank you a lot for your videos! They make learning programming really more enjoyable and I really appriciate the time you spending to make them. Actually I got one question about your study background. Did you also take Algorithms and Data Structures in your degree and could you maybe make a video about it, where you explain what the biggest challenges were for you and what tips and help you would have wished for before the module so that you could pass it successfully? It is just an idea because I am hearing from so many students they are struggeling about it. Best regards Tobias
Personally I always had trouble with Discreet Mathematics...that was tough. Data Structures was easy, as you get to use practical examples and it just makes sense. Discreet Math - very useful but hard to grasp :)
I dont know how to thank you seriously your lectures are amazing 😭😭 Can you please make a video about different functions dealing with single & doubly linked list such as recursion, sorting, finding particular number, comparing linked list, modyfing linked list Its a humble request😭
this was such a good explanation, it made something that a few hours ago ive seem as complicated to something way more simpler, also i liked that there was a camera, i think that using body language made it more digestible, thank you very much!!:)
today in my university our lecturer talked about stack but I did not get anything from her, but after this video, i can say I am 100% understand your video now i am a (zoolly stack) in English means I am quite fully understand
Nicely done. You speak very clearly and concisely. Easy to follow and I am sure novice programmers would learn from this. Cheers! If anything, a dark mode of your IDE would be very nice on the eyes (and us viewers). I don't know if VS supports it; I use open source editors and they all do... Nice to see more women in coding...
13:13 my answer is 2, 1 cause stack is last in first out, the last element we inserted is 3 therefore it will be the first element that will be removed when we perform the pop function
cool video, I don't really find it hard to learn the algorithms through description on leetcode although I'm a beginner but when I search for the detailed explanations on youtube or anywhere else for code implementation its an indian gargling or someone just saying nonsense that makes it harder to understand even though I already understood it. Understanding the problems is quite easy for me but what to code is harder since I don't know all my stuff I am nub. This video is fantastic, I solved an leetcode question only related by topic to stacks with it in C++ which I barely know anything about. Thanks for showing me how to use C++
@@pandax_185 If you dont pass parameters by reference, a function will make its own copy and work with that copy. Because of that the changes will not be reflected on numbersStack variable in main function. ☺️
@@CodeBeauty If we want to pass the parameter by reference for the printstackelements function, then how come we don't use * or & right before the function's parameter?
Thank you for all of your time making clear and understandable lessons, they are extremely helpful and you have a wonderful way of conveying the subject you are teaching.
Something I do appreciate and could agree on but somebody's gotta step in when she can't answer all of the computer programming questions the viewers have.
curious why we dont have to use reference operator (&) when we pass "stack stack" to printStackElements() if anyone sees this and wants to lecture me lol
@@kevinz1991 I'm not sure. Maybe it's because classes and objects uses something like this->attribute instead of this.attribute? Whereas regular variables aren't automatically referenced? I'm sorta confused about it too. What I know for sure is the stack elements were never modified in the function she created. Her function probably took a copy of the original stack from the main method.
I like to think of the rule of stacks like *F*irst In *L*ast out. First in as in the first element gets into the stack. Last out as in the most recent element that has entered the stack gets out of the stack first. As long as our different interpretations have the same meaning, then I'd say I'm not far away from its definition.
Saldina, Do you know what is the difference between : numbersStack.push(100); numbersStack.emplace(100); They both do the same thing but surely there must be a difference otherwise why have both.
That's a good question. The rules of the stack only lets you access the top element, which makes accessing any elements less flexible. I'd say arrays have a good flexibility of accessing elements since there's no "strict" rule of how to access them. So, to print the reverse order of the elements from the stack, the only way I can think of is to transfer the stack elements into an array. Use a for loop to have this array print its elements from the last index to the first index. Of course, you can have this strat in a function. Hope that helps.
Thank you for the video but I don’t understand one thing, why in the printstackelements you have putted “stack.pop();” and in the main function, you added another pop at the end to remove the first result (number 3), so, why there is two time a call for the pop function ?
That's a good question. I think she did her printstackelements function as how a normal person would understand it rather than how a coder would understand it. We usually see the top method to *only* get the last element of the stack. But in her printstackelements function, the logic she used was the person has to take away the top element of the stack if that person wants to access it. Let's use a container of tennis balls for an example. Sure, you can open the lid and just look at the top tennis ball, but if you want to have a better look at it, you have to take out the tennis ball at the top of the container. By having a better look at the tennis ball by having it outside of the container, you also decrease the amount of tennis ball from the container. That's probably why she used the pop method in her function. Now as for calling the pop method in the main function, I believe it's because she gave a coding question @13:00 in this video. Having the code shown 13 minutes in the video, I can only say that you'll have 2 elements printed but if you run the top method again, right after her function, there should only be one element in the stack. Me personally, I prefer the printstackelements to only output the elements of the stack. Hopefully, my response answered your question.
REQUEST: I'm a C# developer and know a little C++, could you explain WHY you should use header files and not just do everything in the .cpp file. It's like extra work that I don't have to do in C#. It also seems like the .h is an abstract class and the .cpp is the implemented/proper class. It probably goes back to old C conventions, but today, with modern compilers and multi-core processors, does it save 'compile time'? Also I notice in your examples you only use .cpp files, maybe just for simplicity, but yeah...so its ok to do it that way? Like if you have lots of classes that #include each other. Thanks!
You *need* to include in order to be able to _use_ the generic stack. If you dont include you would need to implement your own stack-class, based on an array, or more often used a linked-list, but _that_ is at completely different ball-park in a higher division ..
@Scott H To answer a question I may know of, I think it's because if you code a bunch of stuff for your class, then it may take longer to scroll down to your main method. I can understand that creating a .h file and a .cpp file is like extra work. I would personally have everything in one file if I didn't code so much stuff for my class/object.
Thank You for Your video, Saldina. I am sorry if this is a silly question, but what is the difference between stack and array? When should we use stack and when should we use array?
@@raivisrasnacs1088 Not true. Basic-arrays cant be dynamically allocated, but arrays based on new is called dynamic because they allow you to expand the structure. Saldina made a video on the subject ruclips.net/video/mGl9LO-je3o/видео.html @Petar Todorov Todorov If you want to cherry-pick, you need array or linked list. Stack is _pure_ FIFO! You can _never_ access any element that is not on top.
Hi, Saldina! I have to solve many problems with arrays of strings in C++ and I don't quite understand them. Would you like to make a tutorial about them, please?
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
#include
#include
using namespace std;
void printStackElements(stack stack) {
while (!stack.empty()) {
cout
Ma'am please keep uploading videos on DSA.
i like when u put all the code here not the code at the start :p it makes it easy to write it on my notepad with my pencil. It helps me remember stuff when needed.
More data structure, more algorithm stuffs we need Saldina. You rock
ye algorithms, data structures stl stuff and if someone can figure out solution to problems is what is required for interviews as junior also.
who stuffs Saldina again? Algorithm?
Love how you give us a real application example of stack. If you could do more that it be great. Sometimes trying to see c++ in action in software is hard to find.
Hello from Syria Saldine
All thanks to you for the useful lessons you offer, with simple explanations.
I hope you continue with the lessons of data structures and not delay with the lessons. Thank you.
Whoa the UNDO command is a great example of STACKS used in computer science
Something that I never thought of but I have thought of a good example of recursion which are taking a photo of yourself between two mirrors and screen recording/screenshotting your desktop through multiple windows.
@@joegongamer8637i created a video explaining all those concepts you just mentioned ruclips.net/video/v-xI-hAR_Us/видео.html
love how you dissected the concept of LIFO and used actual examples
I was having problems understanding stack memory in computer architecture course, and your explanation made everything clear. Thank you, really appreciate it.
Hello Saldina, Thank you a lot for your videos! They make learning programming really more enjoyable and I really appriciate the time you spending to make them. Actually I got one question about your study background. Did you also take Algorithms and Data Structures in your degree and could you maybe make a video about it, where you explain what the biggest challenges were for you and what tips and help you would have wished for before the module so that you could pass it successfully? It is just an idea because I am hearing from so many students they are struggeling about it. Best regards Tobias
Personally I always had trouble with Discreet Mathematics...that was tough. Data Structures was easy, as you get to use practical examples and it just makes sense. Discreet Math - very useful but hard to grasp :)
The best code teacher, I understand c++ lot better now
Very informative video for on DSA.
Please continue uploading!
i passed my intro to c++ class with flying colors this term! can't wait for next term when we move on to more advanced topics :)
I dont know how to thank you seriously your lectures are amazing 😭😭
Can you please make a video about different functions dealing with single & doubly linked list such as recursion, sorting, finding particular number, comparing linked list, modyfing linked list
Its a humble request😭
This is a crystal clear explanation. Thank you !
this was such a good explanation, it made something that a few hours ago ive seem as complicated to something way more simpler, also i liked that there was a camera, i think that using body language made it more digestible, thank you very much!!:)
oh STL, thanks! There are very useful and on the internet not really a lot of videos about STL.
i saw other videos and i didn't understand anything, about stacks you make it very easy :) thank you!!
today in my university our lecturer talked about stack but I did not get anything from her, but after this video, i can say I am 100% understand your video now i am a (zoolly stack) in English means I am quite fully understand
She is the best ❤
Here.. another informative lecture form you. Thanks very much every week!
Nicely done. You speak very clearly and concisely. Easy to follow and I am sure novice programmers would learn from this. Cheers!
If anything, a dark mode of your IDE would be very nice on the eyes (and us viewers). I don't know if VS supports it; I use open source editors and they all do...
Nice to see more women in coding...
Great video as always! Keep going!!
Thank you for explaining all of this stuff,. Would you please continue with Data Structures and Algorithms with C++ series?
You are so helpful.
prefer so too
Such a Great way to Explain Linked List . Thank you so much Mam. The Concept and Logic is Fully Cleared.
Beautiful and smart, what more could you ask for?
Great video.
Thanks for the simple and great explanation. My professor made this a lot more complicated.
after linked lists with ptrs, this is a lot less hard, thanks Saldina!
and yet those lists was only singleton linked, and had no iterators. Add those, and lists are suddenly even harder, and _then_ stacks are childsplay
@@bearsoundzMusic why broke my dreams
13:13 my answer is 2, 1 cause stack is last in first out, the last element we inserted is 3 therefore it will be the first element that will be removed when we perform the pop function
Thanks for sharing such Valuable Content, That's Amazing!
You are so welcome!! 🤗🤗🧡
cool video, I don't really find it hard to learn the algorithms through description on leetcode although I'm a beginner but when I search for the detailed explanations on youtube or anywhere else for code implementation its an indian gargling or someone just saying nonsense that makes it harder to understand even though I already understood it. Understanding the problems is quite easy for me but what to code is harder since I don't know all my stuff I am nub. This video is fantastic, I solved an leetcode question only related by topic to stacks with it in C++ which I barely know anything about. Thanks for showing me how to use C++
thanks for sharing, sharing to the world your personel experience is the greatest thing a teacher has good job love you💜💜
great content !!
please upload more STL .
Thank you ..
I love your learning strategy
Your videos really help ma a lot
I'm happy to help! 🧡🤗
omg! god bless you you have covered almost everything in one video.
🤗🥰
You should make a video related with Binary Trees too! So far I've enjoyed the data structures tutorials tho, keep it up!
Very useful for learners! Thank you madam!!
Such a great content! Thank you it is really helpful, keep going! you are the best
I will definitely subscribe to your channel I want to learn a lot from you, you make people understand easily
😊💜
More videos about data structure ❤
13:20 The int 3 will be popped out of the stack, the ints 2 and 1 will remain in the stack
you are the best teacher and beautifull person Thanks!!!
Awesome video! After seeing this I will never pronounce parameter the same way :D. Keep the good content coming!
Very clear explanation
☺️🤗
nice one
waiting for queue and trees maps all data structure videos by you soon
Thanks Ma'am!
Is there a way I can see your headerfile that holds eveything in stacknumberStacks? I would like to see how you set up things like pop push top
Never mind, I didnt realize that the functions were all included in the stack and you just needed to call them. Thank you for the video
Mam, ur explanation is superb 👌🏻👏.......pls make videos on DP, BST ,GRAPHS,some complex concepts...................it will help us a lot....tq mam
Pls keep on uploading data structres tutorials
wow it was amazing explaination. thumbs up
Wow, that was a great ecample of last in first out !
Thank you so much for your great teaching of c++
13:10
The answer:
2
1
Yep, great! 🤗🤗
@@CodeBeauty but why? we removed all elements of the stack in the function right?
@@pandax_185 If you dont pass parameters by reference, a function will make its own copy and work with that copy.
Because of that the changes will not be reflected on numbersStack variable in main function. ☺️
@@CodeBeauty Ah right Thanks a bunch ✨
@@CodeBeauty If we want to pass the parameter by reference for the printstackelements function, then how come we don't use * or & right before the function's parameter?
THANK YOU SOOOOO MUCH, u made it look super easy, GOD BLESS YOU
Glad it helped!
Thank you so much I needed this.You explained very well. Thank you
You really are "Code Beauty" 👌
An amazing tutorial!
god bless you sister it's very important and i learn it very much
last in first out. meaning that the most recent input is on the top of stack when reading left to right and top to bottom.
Great explanations!
Thank you for all of your time making clear and understandable lessons, they are extremely helpful and you have a wonderful way of conveying the subject you are teaching.
Always clear.. Thx
Something I do appreciate and could agree on but somebody's gotta step in when she can't answer all of the computer programming questions the viewers have.
Bravo Saldina, pozdrav iz Goražda 😘
great video !!
Thanks again and again !!!
Always welcome! 🧡🤗
2,1
Really helped me alot
But doing more lessons about data structure
Thanks for the great lessons. Is it possible to ask if you can give a lesson in class and header and the connection white the main class.
Thank you.
You're welcome! 🤗
Thanks a lot
Please can you provide more deep
can you make more video cuz ı like it and need it
Thanks
thanks! you explained it very well
so helpful thanks saldina
Kevin you're welcome! 🤗
curious why we dont have to use reference operator (&) when we pass "stack stack" to printStackElements() if anyone sees this and wants to lecture me lol
@@kevinz1991 I'm not sure. Maybe it's because classes and objects uses something like this->attribute instead of this.attribute? Whereas regular variables aren't automatically referenced? I'm sorta confused about it too.
What I know for sure is the stack elements were never modified in the function she created. Her function probably took a copy of the original stack from the main method.
Please make a tutorial on how to make a program that reads data from text file
I like to think of the rule of stacks like *F*irst In *L*ast out. First in as in the first element gets into the stack. Last out as in the most recent element that has entered the stack gets out of the stack first. As long as our different interpretations have the same meaning, then I'd say I'm not far away from its definition.
The elements avail in stack is 1 2
thanks a lot miss Saldina well explained. mush appreciated.
You are simply the best😍🥰😘
Thank you so much! 🧡🤗
@@CodeBeauty am looking forward for a full course on data structure and algorithm in c++🙂
Thanks in advance ☺
how explain very well❤
You are just osm yaar 👍🤘
Thank You ❤️
Saldina,
Do you know what is the difference between :
numbersStack.push(100);
numbersStack.emplace(100);
They both do the same thing but surely there must be a difference otherwise why have both.
Thanks for videos
13:13, 2 and 1 will remain
Ohhh God
How can i tell you this video is amazing
you are too good
Thank you Salina 🥺
Thank you so much. How to print reverse order of elements?
That's a good question. The rules of the stack only lets you access the top element, which makes accessing any elements less flexible. I'd say arrays have a good flexibility of accessing elements since there's no "strict" rule of how to access them. So, to print the reverse order of the elements from the stack, the only way I can think of is to transfer the stack elements into an array. Use a for loop to have this array print its elements from the last index to the first index. Of course, you can have this strat in a function. Hope that helps.
Can you make a video about array of char vs string pls? I tend to have a lot of problems with strings on c++
yes i think he should do that
Please refrain from using system("pause > 0" or at least let people know it s only for Windows users. Great job thou! Well explained.
Yep, it's only for Windows PC. I had to make a video about system pause because some people were asking why I didn't work on their machines 😅
Thanks 🥰
@@CodeBeauty Keep up the good work. Use return 0; in all other OS.
C++ has a header file for Stack functions?
Neat!
C was a disaster
Wow, Saldina thank you.
Thank you for the video but I don’t understand one thing, why in the printstackelements you have putted “stack.pop();” and in the main function, you added another pop at the end to remove the first result (number 3), so, why there is two time a call for the pop function ?
That's a good question. I think she did her printstackelements function as how a normal person would understand it rather than how a coder would understand it. We usually see the top method to *only* get the last element of the stack. But in her printstackelements function, the logic she used was the person has to take away the top element of the stack if that person wants to access it. Let's use a container of tennis balls for an example. Sure, you can open the lid and just look at the top tennis ball, but if you want to have a better look at it, you have to take out the tennis ball at the top of the container. By having a better look at the tennis ball by having it outside of the container, you also decrease the amount of tennis ball from the container. That's probably why she used the pop method in her function.
Now as for calling the pop method in the main function, I believe it's because she gave a coding question @13:00 in this video. Having the code shown 13 minutes in the video, I can only say that you'll have 2 elements printed but if you run the top method again, right after her function, there should only be one element in the stack. Me personally, I prefer the printstackelements to only output the elements of the stack. Hopefully, my response answered your question.
Thank you so much for the info
Hi Saldina, can you make a video about templates
Here is a video that could help you! 🤗
ruclips.net/video/qrJjFN4Igfw/видео.html
#include
using namespace std;
class ali{
public:
string name;
ali*next;
};
void print(ali*a){
while(a!=NULL){
cout
i had writen this code is that correct please
thank you for your video 🙏🙏🙏
thank you, you're awesome!
REQUEST: I'm a C# developer and know a little C++, could you explain WHY you should use header files and not just do everything in the .cpp file. It's like extra work that I don't have to do in C#. It also seems like the .h is an abstract class and the .cpp is the implemented/proper class. It probably goes back to old C conventions, but today, with modern compilers and multi-core processors, does it save 'compile time'?
Also I notice in your examples you only use .cpp files, maybe just for simplicity, but yeah...so its ok to do it that way? Like if you have lots of classes that #include each other. Thanks!
You *need* to include in order to be able to _use_ the generic stack. If you dont include you would need to implement your own stack-class, based on an array, or more often used a linked-list, but _that_ is at completely different ball-park in a higher division ..
@Scott H To answer a question I may know of, I think it's because if you code a bunch of stuff for your class, then it may take longer to scroll down to your main method. I can understand that creating a .h file and a .cpp file is like extra work. I would personally have everything in one file if I didn't code so much stuff for my class/object.
Thank You for Your video, Saldina. I am sorry if this is a silly question, but what is the difference between stack and array? When should we use stack and when should we use array?
Size of an array can not be dynamically changed
@@raivisrasnacs1088 Not true. Basic-arrays cant be dynamically allocated, but arrays based on new is called dynamic because they allow you to expand the structure.
Saldina made a video on the subject
ruclips.net/video/mGl9LO-je3o/видео.html
@Petar Todorov Todorov If you want to cherry-pick, you need array or linked list. Stack is _pure_ FIFO! You can _never_ access any element that is not on top.
please make a vedio covering all the data structures and thank you so much for your vedios.
Hi, Saldina! I have to solve many problems with arrays of strings in C++ and I don't quite understand them. Would you like to make a tutorial about them, please?
Upload data structure remaining video's.