Introduction to Linked Lists, Arrays vs Linked Lists, Advantages/Disadvantages - C++ Data Structures
Vložit
- čas přidán 27. 07. 2024
- A linked list is a data structure used to store and organize data. This tutorial is an introduction to linked lists. You will learn how to use linked lists, the important advantages and disadvantages of linked lists, the differences between linked lists and arrays, and how to implement a linked list in the C++ programming language. I'll also teach you how linked lists work with functions and how you can access elements of the linked list (nodes) and how you can pass the linked list to a function.
📚 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.
Download Visual Assist here: bit.ly/WT-CB
I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
Download Ultra Edit here: bit.ly/UE-CB
It is a powerful, secure text editor designed specifically for programmers.
☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. Use the link to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
Contents:
00:00 - What will you learn in this course?
00:40 - Introduction to linked lists, What are linked lists?
03:35 - Differences between linked lists and arrays, advantages/disadvantages
07:28 - How to implement a linked list in C++
12:52 - How to link the nodes (How to link the elements of the linked list)
16:03 - Linked lists and functions
Other tutorials mentioned in this course:
Lists (real app example) - • C++ List (Real example...
Arrays - • DATA STRUCTURES - How ...
Structures - • C++ Structures for beg...
Classes, OOP Playlist - bit.ly/3sn0WQt
Pointer Playlist - bit.ly/2NXCjex
Tag me on you Instagram story:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty - Věda a technologie
📚 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.
Could you make a Vector Video? By the way i like you soooooo much :)))))))))
I struggle with my professor's way of explaining this. You did it in just 24 mins. Thank you.
Happy to hear that ☺️🤗🥰
Learned more in 24 mins than my professor in 2 hours. Thank you!
Same
I wholeheartedly agree, I'm taking data structures and algorithms this semester, and what the prof took to explain in a week, 23 mins got me more!
@@adamburri1088same lol
I am a college student who is watching in Korea
There is no such high quality C++ video in Korea
Thank you for the good video!!
You're the only one that finally made this understandable to me. Thank you so much plz continue this series !! I would like to see the series upgrade to the intermediate level. Thank you again, Saldina!
I agree! This was sooo helpful! Thank you very much!
same TT
I really appreciate your work, you helped me understands this particular topic which was both easy and confusing at the same time.
Keep it up💪🏻
Clear and Concise explanation!
Backed with a lot of Well Supported, Real world Examples.
Learning C++ through your channel is so much of joy!!
I recently discovered your channel and I just have to say that you are doing an amazing job with these videos. You have a great teaching style and I love the way you use practical examples to illustrate concepts.
I use C++ when working with microcontrollers like the Arduino, and while there are a few syntax differences it is very similar, so your videos have been a great resource.
I know you get many requests for other languages as well, and as a CZcamsr myself I understand that it's impossible to entertain them all. If I were to make a request I would love to see you do a series on Python after you conclude the C++ tutorial series. So you can add that to the list!
I wish you every success with your CZcams channel.
Thank you so much for that comment! I really put a lot of work into these videos, especially to overcome the foreign language obstacle, so I appreciate very much the support that I get.
I have a lot of TODO videos, and I also have to be honest and say that Pythons is not my strongest language.
I was planning to focus on C++, C#, and JS mostly because those are the languages that I use the most, but I don't have any fixed plan for the future. Are you interested in those maybe?
I wish you the best of luck with Arduino programming and a lot of success with your channel as well. 🤞🧡🧡
@@CodeBeauty Well I would say that you have definitely overcome the foreign language obstacle, your English is excellent.
I certainly will be interested in seeing more of your C++ videos and look forward to the JavaScript ones, I have familiarity with both languages but it has been a few years since I used JS, so I'm sure I'll learn something.
Keep up the great work Saldina, I predict that you'll soon have a CZcams Silver Play Button to hang on your wall!
Mr DroneBot in the house!
@@CodeBeauty Guess what your English is more understandable than (no offense) other programming CZcamsrs. I really appreciate your effort and we will continue supporting you.
@@CodeBeauty this is the best best crossover of 2021!
your videos are insane, you made me feel that c++ wasn´t as difficult as it was being for me at university, thanks a lot and best wishes from Spain.
You are a life saver I have taken data structures three times and never understood it especially linked lists and you made it so simple THANK YOU T--T
Thank you so much!!!!! This video was so helpful in helping me study for finals as well as understanding my data structures class. You made this concept so much easier to understand than my professor.
By far the best video I've seen on link lists and the implementation of them in C++. Oh my god so many videos go into understanding what they are, but never teach what an implementation of them look like especially the syntax when being introduced to new syntax like -> which I wasn't aware of, or how you need to link your link list otherwise it's no longer a link list. This is a lifesaver and doesn't start with some syntax that no one has ever seen before and keeps it basic. If you go into anything a bit weird its explained. Thank you so much for the video it was super helpful in understanding what implementation of a link list looks like in C++.
Loveeeeee the explaination. I feel like you do a good job in explaining the things that sometimes are pushed under the rug and that is sometimes the difference between feeling completely stuck vs finally understanding an otherwise simple concept.
This video made my life so much easier. I've been struggling in my data structures class for 10 plus weeks now, professor was confusing to listen to, tutor was confusing to listen to but this video made everything clear
I recently came across your channel and I must say the way you explain is commendable. Thanks for such great explanation of all the minute details of the code
By watching this video I have contemplated not only the beauty of code, but also the beauty of programmers. Thanks a lot for that video! Seems to be one of the most beneficial.
These are really informative video's. I appreciate you taken the time to do so. Thank You and Cheers!
Finally after trying for almost a week and surfing dont know how many channels i found this channel who make me understand how to create a linked list in minutes at once
I cant thank you enough literallyy tears in eyes .. Thank you you are realky doing a great work each concept is clear avout creating a linked list .
Thank you so much
Love how you explain everything so simple and easy!
Happy to hear that you learn from videos! 🤞🤗🧡
@@CodeBeauty I second Milka's comment! I've spent a ridiculous amount of time (hours) reading and rereading my text book to understand linked lists and you very eloquently showed me in a matter of minutes. Thank you and keep up the great work! I will be following you for more C++ videos as this has been a trouble language for me to pick up. Best of Luck!
You are the best. You really explain very well wow. My professor took two classes which mean 150 minutes to teach about the Linked list but still, I didn't get it but now in less than 24 minutes I learned a lot from you. Thank you.
Thank you very much ! You're the best ! 😌 You've gotten me into programming again … !
I decided to watch the entire video at 1am for fun instead of going to sleep. Linked lists have never been this clear to me until now, thanks to you!
haha! great. 1am is good to learn. kudos to you
amazing explanation.. i wish i had a teacher like you.. respect... in this era where people are making insta youtube reels , which are absolute trash.. people like you are really motivating us.
Wow, thank you for the brilliant explanation! You make everything sound so simple. I have only ever used std::list, so to understand how linked lists actually work under the bonnet really helps.
I'm happy that you find my explanation helpful and that you understand how LL work inside 🤞🤗🤗
You explained the linked list very clear and concise. Thank you!
Clear and concise. Thank you for your help!
I really love the way you explain things.
beautifully explained .you just made it sooooo simple to understand.thank you.....
Thanks you so much Your videos are very helpful and simple to understand.
Thank you so much di ! this helped me a lot !!! May the force be with you !
My last year until I graduate BS computer Science ... Thank you so much your lessons are great.
video posted on 24/Feb/2021, Today 8/Dec/2021 still helpful and will continues being helpful. *Thanks Saldina*
Thank you so much, I didn't have much knowledge about pointers to begin with, yet your explanation was so nice that I didn't need to revisit it at all.
☺️🤗🥰
Your videos are very helpful. You explain well. Thanks!
Thank you very very much Saldina, your videos on C++ are so precious and understandable.
😊🥰
Thank You
This video helped me in understanding concept of the linked lists,
I have watched many videos but this video makes everything clear.
Thnx, you are great in explaining things....
You are so amazing! I love your teaching and can't wait to learn more!
Thank you so much, your way of explaining is so clear and understandable. I really needed this video!!
You're welcome 🤗🥰
as a long-ago C/C++ dev (c. 1998) and a current Kotlin Java dev, this is relevant to my work and interests!
Thank you for all these amazing videos, I really love the way you use to teach, would you show us how we make a doubly linked list please, thank you again.
Your channel has been a huge help and now I look for your channel when searching for a topic regarding C++, would you ever make a video regarding destructors as well?
Amazin job in such a way that, you train viewers from basic to advance without missing any aspect.
Hi, I really enjoyed the video and it also clears my concepts about linked lists. I have a request you to make a video on doubly linked lists as well as possible. I'll be very thankful for this. Thanks.
CodeBeauty, Thank you so so much for all you do. Please don't stop making your videos. Could you do a video on event streaming such as kafka?
I find it so easy with your explanations.
thank you for breaking it down like this!
Finally understood after going through many videos. Thank you
You're a saviour. How nicely you have made me to understand the topic i cant explain thanks
🥰
Thanks for the video!
Excellent explanation.
Thanks you for your efforts.
Definitely one of the best channels ever seen ❤️
Thank you so much for taking your time to explain this concept in a very detailed way.
You are so inspiring 💪.
Lots of love from Peru💖
By the way, please, can you make a video about how to create a Linked list, insert and delete a node, but using pointers to pointers ??
For example, a function that creates a linked list that uses a pointer to a pointer would look like this: void createList(NODE **head)
What are the advantages of using pointers to pointers? and when should we use them ??
Phenomenal explanation, thanks!
Very clear, as always
Your videos are very helpful :)
Happy new year bonita... Excelent video... Please more like this with data structures
I really appreciate what you do, thank you
thank you so much !! your explanation is great!
Yes, I got now easy explanation . Thanks and upload more.
You are a life saver. Thank you!
You are a LIFE SAVER thank you from the deep of my heart.
Wow, you explain better than my teacher! Thank you!!
Hi,
congrats, your videos are just perfect to understand.
Can you make more videos related to linked lists, covering INSERT, REMOVE, CHANGE or LOOK for items in a list?
Thanks
i have seen many videos..but only from ur video i learned it and best explanation..thankuu
women are very caring and have a very good way of explaining things ♥️♥️I'm proud of you
Thank you so much for this genuine comment! ❤❤❤
Thank you for the video it was very helpful. It would be also great if you could make a video about Lambda functions in C++
You helped me a lot, thank you 🙏
thank a lot, great video.
From Vietnamese student with love!
amazing concept love your teaching method
Thank you so much 💗😊
It really helped me
you are truly the best
Thanks, you nailed it
this is a fantastic explanation, wow
Great explanation ....thank you 😊
Awesome Explanation
Thank you Ms.Coding Lady.
Thank you so much Mam !! Your videos are so much helpful👍.
Thank you for your great explanation!
I was having doubts with this very topic. Nice video!
😊🧡
wow!! I just discovered your channel- i've always struggled to understand linked lists but in this video, everything just clicked. THANK YOU SO MUCH
🤞🤗🥰
Thank you, this was a very helpful video!! :)
Your teaching style is very good the best teacher ever..❣
void printList(Node *head)
{
if (head->Next != nullptr)
{
cout Value Next);
}
else {
cout Value
Thanks for this awesome video.
You are best and your content is very very easy and understandable easily
Good content and well explained. Thanks!
This video was helpful 💯
Thank you for fluencer and understandable English ❤
very use full video ma'am thank you
I caught the beginning but was distracted through the middle. I caught the question, my answer was "It needs the Head. It requires a basis, a point of reference from which to start".
I start my degree next week, and even though I have no previous experience, when you said the answer was the same as mine I cannot express the joy I felt.
Thanks so much for taking the time to make videos like this. It may seem like "revision" to someone familiar, but to someone like me (and your recommendations on learning Java at the start), I don't know it's hard to explain.
But you're so damn attractive I can't concentrate lol and it's mostly why I was walking around listening half the time. I can never look at Batman the same way again. However, I'm sure I'll manage :)
In all serious, you're wonderful. You and many others like you ( e.g. freecodecamp) have really opened my eyes to a wonderful new world for me to explore. I'm so excited!
Please, don't stop. Any of you.
I found it really hard to understand the concept of linked lists but you made it seem very easy. Thanks!
hanks lot Sir.. You helping us..
Thanks! This video really helped.💖💖
This video is so well explained, thanks allot
Epic tutorial, thanks!
you are the only one who is helping me to be a c++ advanced learner
Thank you so much for your effort.
If people don't want to use public variables in a class (not pretty cool to use public variables in classes and not so great to practice) they can check this code right here. I did some OOP things:
class Nod { // Nod = Node in my language
int valoare; // valoare = value in my language
Nod* next;
public:
// I did a constructor also to avoid making a very big column of initializations. If I don't pass the next Node, then the default value is a nullptr;
Nod(int valoare, Nod *next = nullptr) : valoare(valoare), next(next) {}
// Here are some getters and setters that can access the private variables.
void setValoare(int valoare) {
Nod::valoare = valoare;
}
void setNext(Nod *next) {
Nod::next = next;
}
int getValoare() const {
return valoare;
}
Nod *getNext() const {
return next;
}
};
void printList(Nod* n) {
while(n){
std::coutgetValoare() getNext(); // This is a pointer so that's why you can do this.
}
}
int main() {
// linked list example with 4 elements:
Nod* head = new Nod(1);
Nod* second = new Nod(2);
Nod* third = new Nod(3);
Nod* last = new Nod(4);
// here I was pretty lazy to implement the pointer in constructor thing (the stuff you need to pass as a parameter to the construct to point to the next node) so I did this:
head->setNext(second);
second->setNext(third);
third->setNext(last);
printList(head);
// std::cout
Thank you ma'am. helped a lot.
Thank you so much.
This leson is very usefull thanks very muthc
You are the best teacher