Тёмный

Tree data structure - types of trees, examples, code and uses in programming 

CodeBeauty
Подписаться 277 тыс.
Просмотров 77 тыс.
50% 1

📚 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. You can use the link below 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! ❤️😇
In this video, you'll learn about Tree data structure.
You'll understand when is a tree data structure used in programming, learn all the most important concepts, different types of trees in programming and their characteristics, and see how to apply all of this in cod. After watching this video you'll know how to create your own tree data structure and add elements to it.
Tree traversing algorithms (part 2) - • Tree traversal algorit...
Contents:
00:00 - What will you learn in this video?
00:32 - Introduction to Trees data structure
01:09 - Usage of Tree data structure in programming
02:38 - Most important concepts
05:01 - Different types of trees
06:06 - Binary Search Tree
07:33 - Writing and explaining the code
08:35 - How to create and add a new node to the Tree
10:51 - Let's program your first Tree
12:29 - Another Tree example (more complex)
AI code completion tool that I use in this video - free download here:bit.ly/FreeTabnine
You can also follow me on other platforms:
Instagram 📸 - / truecodebeauty
Twitter 🐦- / truecodebeauty

Наука

Опубликовано:

 

5 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 199   
@CodeBeauty
@CodeBeauty 2 года назад
📚 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. Code from this video: #include using namespace std; struct Node { int data; Node* left; Node* right; }; Node* createNode(int data) { Node* newNode = new Node(); newNode->data = data; newNode->left = newNode->right = nullptr; return newNode; } int main() { //Level 1 Node* root = createNode(1); //Level 2 root->left = createNode(2); root->right = createNode(3); //Level 3 root->left->left = createNode(4); root->left->right = createNode(5); root->right->left = createNode(6); root->right->right = createNode(7); //Level 4 root->left->right->left = createNode(9); root->right->right->left = createNode(15); cin.get(); }
@mackenziejackson2888
@mackenziejackson2888 Год назад
I can't show enough appreciation for you diving into data structures. I am preparing to go into a data structures course this fall and you have been invaluable in introducing these concepts. Not only do I feel less intimated but you have a way of making these videos interesting and fun. Many of my classmates feel the same way. Your teaching reminds me why I wanted to study programming in the first place.
@phantomghoul2846
@phantomghoul2846 Год назад
i can't believe this is better than the damn courses I bought on skillshare. straight right to the point and showing us the common functions that are going to be used. kudos and thanks for this video
@user-us1un9rm8r
@user-us1un9rm8r Год назад
I come straight to your page for every new week of content in my C++ class. Thank you!
@mr.potato8894
@mr.potato8894 2 года назад
The timing of this video is perfect. Just started learning this in university. Now I can learn ahead and show off next class xD
@CodeBeauty
@CodeBeauty 2 года назад
Some people are striving to be the best. Way to go!! ✨✨
@yangamasibulelemdede4191
@yangamasibulelemdede4191 Год назад
I really enjoyed your video, I am a University student (South Africa) doing Computer Science second year this year... and I really admire your tutorials. This is surely a channel I will recommend to all IT and Computer Science students. I remember last year when I was a first-year student; so in the first semester I did Problem Solving in C++ and because by then I didn't know you yet, I got 54% as my final grade for Problem Solving (that's bad). And in the second semester, we did OOP in C++, and I was really struggling with it. But after bumping in your videos my marks went skyrocketing up, and I got 73% in OOP as my final mark, could you imagine, I knew you (your RU-vid videos) just two weeks before writing the final OOP exam but I managed to get a better grade. This year I am getting abused by C++ Data Structures, it's hard but I'm giving it my all, and lucky enough I have you at my rescue. @CodeBeauty You are the best.🤝👏👏
@CodeBeauty
@CodeBeauty Год назад
I appreciate this so much 💓
@igor-haha
@igor-haha 2 года назад
Odlični videi Saldina! Jako lepo objašnjavaš, jednostavno a ipak kažeš sve bitno, i još pokažeš na primerima. Hvala na trudu, samo tako nastavi! Pozdrav iz Srbije
@gammyhorse
@gammyhorse 2 года назад
This channel is a precious gem.
@bl00dspec75
@bl00dspec75 Год назад
Hey Saldina. I first saw you on the freeCodeCamp video and immediately connected with your teaching style. I have been loving the data structures series so far. Both the C++ video and this series helped a great extent in coming back to C++ after about 6 years. I feel like if you could continue the data structures series it would have been great - implementing different styles and algorithms in the way. These can be concepts like recursion, backtracking, two pointer approach, sliding window, dynamic programming. You get the gist :D Anyway, thanks for all this. Greatly appreciate it!
@crazyzombie9720
@crazyzombie9720 2 года назад
I’m currently in a Data Structures class at my university. When we got to trees, that’s when this video was uploaded 🤯
@CodeBeauty
@CodeBeauty 2 года назад
it's a sign 😃😃
@AdrianPerez-mr1nd
@AdrianPerez-mr1nd 2 года назад
I’m also enrolled in data structures at my local university. This is very helpful!
@TonyStark-lw7lv
@TonyStark-lw7lv 2 года назад
Thanks for starting this topic. Waited for this 🤝🏻. Thank You Again.
@abdelmalek9004
@abdelmalek9004 Год назад
if the children are connected it would be a graph data structure instead of tree
@CodeBeauty
@CodeBeauty Год назад
Yess 😁
@rmt3589
@rmt3589 5 месяцев назад
Thank you so much! It's what I'm actually looking for!
@MarcusHCrawford
@MarcusHCrawford Месяц назад
All trees are graphs.
@jovanaycart
@jovanaycart Год назад
Your videos are the most helpful on data structure foundations and c++ that I’ve found on all of RU-vid. Thank you! Could you do a video of black red trees
@PreludeSon
@PreludeSon Год назад
This is such a great tutorial...the pictorial truly help.
@mariacunha8508
@mariacunha8508 Год назад
I really appreciate this videos!!! Thank you so so much!
@Reem-du7sd
@Reem-du7sd 2 года назад
YESS! Another video! Hope you can upload a part 2 to the doubly linked list as well. :) Keep up the great work! You're saving every c++ beginner at a time ❤
@nguyenviet908
@nguyenviet908 2 года назад
thank you very much, wishing you all the best!
@Rebel084
@Rebel084 2 года назад
Yo I’m literally working on a project in class for this!!! Perfect timing
@birger928
@birger928 2 года назад
Thank you! You are great! 👏🏼
@leoleo20100216
@leoleo20100216 Год назад
Very clear explanation for binary tree c++ implementation
@techymoh
@techymoh 2 года назад
Just going through DSA and this is helpful.
@MarcusHCrawford
@MarcusHCrawford Месяц назад
Your videos are so helpful. Thank you!
@CodeBeauty
@CodeBeauty Месяц назад
I'm glad to hear that! 🥰
@luisalamo2658
@luisalamo2658 Год назад
You're terrific at explaining these concepts in such a simple manner. Thanks a lot, I can remember at university a few years ago when I was afraid about this tree data structure.
@G_.G_.G
@G_.G_.G Месяц назад
Really thankyou for this video This video clear my doubt which I have been searching for few hours.
@ngongocnam4239
@ngongocnam4239 20 дней назад
I love you. My teacher ❤. You was explained clearly and easy to understand what things you wanna share to others
@granumuse7847
@granumuse7847 2 года назад
First of all, your narrating "bugs" are not that bad as you think 🤣 This intensity of them is created only in your brain, as a result of the conflict between what you expected and what finally occurred 😊 To us, nothing bad happened at all. Secondly, bravo!!! The easiest explanation of tree data structure on RU-vid. Thank you 💖
@mahmoudhagag4234
@mahmoudhagag4234 2 года назад
Welcome back, we missed you💙
@DRdr123
@DRdr123 2 года назад
Thank you 😊 from Egypt
@tobiluchi911
@tobiluchi911 2 года назад
Wowww that's what I'll be learning this year! Thanks a lot ;))
@railway-trainstramssubways1584
@railway-trainstramssubways1584 2 года назад
Greetings from nearby Bulgaria! Great video! Currently studying c++ programming in the university and your videos help a lot!
@dongyangchen5460
@dongyangchen5460 2 года назад
they are very helpful, ty!
@nagen78
@nagen78 Год назад
your tutorials are superb and looking forward for similar tutorials in Python
@emmanuelsharp7031
@emmanuelsharp7031 9 месяцев назад
you are a blessing
@Edxylom
@Edxylom 2 года назад
I love Saldina I was need this video! a Video explain Hash Tables will be amazin!!
@BantuBeast
@BantuBeast Год назад
Thank you!
@HeyitsGift
@HeyitsGift 2 года назад
THANK YOU FOR THIS!! I have literally been checking weekly for a new video by you 🥺❤ & you came through!
@CodeBeauty
@CodeBeauty 2 года назад
❤️❤️
@asthajain7207
@asthajain7207 Год назад
Now I started understanding things better by your video could you please upload a video on a circular linked list...... ♥️♥️
@peterchisangamwamba9100
@peterchisangamwamba9100 2 года назад
thanks patiently waiting for the next video on trees
@nasiriqbal6004
@nasiriqbal6004 Год назад
Love you from Pakistan. You speaking and teaching style is behind the boundaries
@nasiriqbal6004
@nasiriqbal6004 Год назад
@codebeauty Please Cover the Whole Tree. i think you can teach us better than any programmer.
@AwaisKhan-th8fo
@AwaisKhan-th8fo 2 года назад
Thanks you so much ma'am.
@davronxonmuxamedaliyev4377
@davronxonmuxamedaliyev4377 3 месяца назад
You are indeed, the teacher every student dreams of...😂
@BunnyHuggerr
@BunnyHuggerr 2 года назад
First of all thanks for your amazing tutorials! helped me a lot with C++ OOP. Off topic - are you going to teach as well C#?
@CodeBeauty
@CodeBeauty 2 года назад
I might do a C# course as well. I love C# and I've been working in it for 5+ years, so if there is enough interest I would gladly do that course :D
@BunnyHuggerr
@BunnyHuggerr 2 года назад
@@CodeBeauty Amazing :D just started programming less then 2 years ago and no idea why I found it a bit harder then I thought it would be. :| Thanks again for your time and afford! most appreciated !
@temirkhanamanbaev42
@temirkhanamanbaev42 2 года назад
You are great 👍!
@mindlessmeat4055
@mindlessmeat4055 Год назад
Coming from a mathematics background, trees are something i have studied in various classes. Thank you for your videos, they are immensely helpful. Does the data have to be integers or can they be some other type of sequential reference system? Like what if it was a list of college classes? They are list like math101 or cs101.
@suhas5605
@suhas5605 2 года назад
Please complete data structures as soon as possible with all topics covered...
@dedsec2084
@dedsec2084 2 года назад
Hi can you make series on python your concepts are so easy to understand and it would be awesome you make a series on this language btw love your videos
@sikirusalau9460
@sikirusalau9460 Год назад
This is awesome! Thanks for explaining in a easy to understand way. How do you free the memory created by the new keyword? I understand delete is used to free memory or sometimes calling a destructor but I'll like to know how you free the memory.
@faujayikhsan2194
@faujayikhsan2194 Год назад
appreciate, thank you so much for this, hope you have a wonderful day
@tryit1568
@tryit1568 2 года назад
Thanks so much for this !!!! I love these Data Structure Videos Graph Data structures next please 🙏!! ❤️❤️
@Sportsman134
@Sportsman134 Год назад
for the BST rule described at 8:50 (left child should have the value smaller than its parent, right child should have the value larger than its parent), does that mean if you input the following values in this order: 30, 15, 20, 40, 50, 55 (without giving it left,right ordering), it would have to populate a tree the same as in your example?
@mudkiptheengineer5339
@mudkiptheengineer5339 Год назад
The BST tree is also known as red black tree, in order for it to work the data type can be compared, in this case you are talking about ints so it would be done automatically, but if it were a user defined type you'd have to overload the '>' operator
@SavageScientist
@SavageScientist 2 года назад
Awesome video great content
@RealCatDev
@RealCatDev 7 месяцев назад
Very gut video
@dileep.b5054
@dileep.b5054 2 года назад
please make a video on UML DIAGRAMS as soon as possible
@voidray0988
@voidray0988 2 года назад
Can you please make a video about how to take a line from a file and put it in a fuction ...and i love your videos you help a lot of people keep it up😁😁
@ladymorwendaebrethil-feani4031
@ladymorwendaebrethil-feani4031 2 года назад
Perfect.
@leoara8019
@leoara8019 2 года назад
great video in perfect time...thank you so much for the video.
@saifmos6516
@saifmos6516 2 года назад
i would really love to know your settings on vs , wuth that i mean for example your code formats , could you please share this with us ? thank you : )
@chiragsawajiyani8540
@chiragsawajiyani8540 2 года назад
Can you please make a full detail course for c#.
@aliniaz6448
@aliniaz6448 2 года назад
If you open cmd in a specific folder and type tree command cmd will show you the tree of that folder
@CodeBeauty
@CodeBeauty 2 года назад
Yes, great example! 💜💜
@Asterics.
@Asterics. 4 месяца назад
thank you bst 😉
@CodeBeauty
@CodeBeauty 3 месяца назад
Welcome 😊
@johnnycanuck6923
@johnnycanuck6923 2 года назад
Hey Saldina, thanks for your information! If you were my teacher when younger I would be better than Billy Gates now LOL!!
@pikimk6167
@pikimk6167 2 года назад
Graph, and i hope you make a video about graphs 😀
@CodeBeauty
@CodeBeauty 2 года назад
Yes, correct answer 😃😃
@adilkayani
@adilkayani Год назад
This lady is a codebeauty and a real beauty. )) And funny too. )) I mean, she has a great sense of humor.
@julioventura2867
@julioventura2867 Месяц назад
a little question , i 've been asked to do a binary search tree data structure, but there are values that are the same as others, how do you deal with that ?
@infamoustony
@infamoustony 6 месяцев назад
the data structure on 3:35 is graph
@CodeBeauty
@CodeBeauty 6 месяцев назад
Yes 👍🤗
@aliomidi9613
@aliomidi9613 Год назад
your teach better than my university professor
@Tech_Diaries_With_Vincent
@Tech_Diaries_With_Vincent 25 дней назад
amazing😍
@CodeBeauty
@CodeBeauty 25 дней назад
I'm happy to hear that 🥰
@noobclasher7471
@noobclasher7471 2 года назад
Badly need it...your videos saved my exam last week....this topic coverd in recent class but i don’t understand well..thanks and take ❤️❤️❤️❤️
@CodeBeauty
@CodeBeauty 2 года назад
Even though I finished University a long time ago, I still remember the feeling of trying to focus and follow the lectures, but not understanding ANYTHING! That's why I make detailed and step-by-step lessons and cover all the important facts, so that it is easy to learn and make progress. 🥰
@JorielTejada-te4dd
@JorielTejada-te4dd Год назад
How about Graph Data Structure? Can You teach us about that algorithm? please?
@gauravpathak560
@gauravpathak560 2 года назад
hii selena ur way to teach is really awesome. U make more videos on DS and Algorithms . Kindly cover trees and graph important algos also.Keep it up....
@richardshane2080
@richardshane2080 2 года назад
Theoretically the Earth's population that's plugged in is a bit less than the total population, however the theoretical limit with a database is the hardware lol ....lovee de program on anything especially binary......ty, big hugs 🤗 everyone
@linhtetaung2613
@linhtetaung2613 Год назад
directed acyclic graph
@anschoudhary1376
@anschoudhary1376 2 года назад
for 12:07 can we do newNode->left && newNode->right = nullptr;
@kamilaarshad5427
@kamilaarshad5427 2 года назад
why we are using Node * as data type for left and right node
@mudkiptheengineer5339
@mudkiptheengineer5339 Год назад
if I'm not mistaken, the "BST" tree is also called a RedBlack tree
@Thebiggame-dc8ek
@Thebiggame-dc8ek Год назад
I paused the video and now I want to answer your question😁. we can create a left node with the createNode function, for example, and give its address to the pointer of the root.
@CodeBeauty
@CodeBeauty Год назад
Did you continue watching the video, is your answer correct? 😃👊👍
@tarekbenlakri1058
@tarekbenlakri1058 Год назад
hey could you answering me what is the difference between NULL and nullptr
@jasonyu7963
@jasonyu7963 2 года назад
if the child are also connected is it a circular singly linked list?
@ajitpatil6532
@ajitpatil6532 2 года назад
Just about 3 days ago I was trying to find your video for this topic, and today you posted it!
@arshmaanali714
@arshmaanali714 2 года назад
Thank you so 😍😍much mam ❤️🇵🇰🇵🇰🇵🇰
@orangeeezoe
@orangeeezoe 2 года назад
Is that the graph data structure for the closed loop?
@_Omni
@_Omni Год назад
Yes
@namelessboy55699
@namelessboy55699 2 года назад
an intelligent and beautiful woman indeed, cant get tired of watching your tutorial and you
@nanof1948
@nanof1948 2 года назад
can you make video's to explain java
@jameskaiser7474
@jameskaiser7474 6 месяцев назад
What do a root node and batman have in common?
@178fahimahmed7
@178fahimahmed7 2 года назад
Yesh, It's a graph in 5:22
@spicyshizz2850
@spicyshizz2850 9 месяцев назад
Bsts trees bruh ;)
@anime-fights9123
@anime-fights9123 11 месяцев назад
do you have any video of data structures using classes
@CodeBeauty
@CodeBeauty 11 месяцев назад
My two last videos are about arrays of objects, and I have a couple more comming 😃
@ehapahmed1069
@ehapahmed1069 3 месяца назад
will it differ if I used class instead of struct ?
@CodeBeauty
@CodeBeauty 3 месяца назад
Nope, but there is one important difference between class and structure. Do you know what it is? 😃
@dbglorious
@dbglorious 2 года назад
When childrens are interconnected it forms a graph structure.
@CodeBeauty
@CodeBeauty 2 года назад
Yes! Finally someone with the correct answer! 😃😃🥰
@dbglorious
@dbglorious 2 года назад
@@CodeBeauty it was a surprisingly Quick Reply. 😍
@CodeBeauty
@CodeBeauty 2 года назад
I was waiting for the correct answer 😁
@skeptisch2751
@skeptisch2751 2 года назад
We call it mesh in networking
@dbglorious
@dbglorious 2 года назад
@@skeptisch2751 its your problem 😏😅
@montyGator
@montyGator 2 года назад
I don't quite understand line thirteen in the createNode function, can anyone explain that to me?
@thealphabetissilent3447
@thealphabetissilent3447 Год назад
What is the DSt at 6:10?
@kavyapatel593
@kavyapatel593 2 года назад
I think the data structure you showed on paint was a graph?
@CodeBeauty
@CodeBeauty 2 года назад
yes 😃
@simplyritik
@simplyritik 2 года назад
Bssst🐝
@tarekoumansour1503
@tarekoumansour1503 Год назад
it is a graph data structure
@CodeBeauty
@CodeBeauty Год назад
Yes, correct 😁
@robertpaukovic6811
@robertpaukovic6811 Год назад
nullprt was not declared in the scope ??
@BooleanAutocrats-mc2ny
@BooleanAutocrats-mc2ny Год назад
They are called circular linked lists
@MrLaruzer987
@MrLaruzer987 2 года назад
How do I identifier not found On root = createNode(1);
@chrishabgood8900
@chrishabgood8900 6 месяцев назад
It’s like double link list?
@alexconklin-rn4jd
@alexconklin-rn4jd Месяц назад
3:34 its a cyclically linked list right? :D
@dominikwasiewicz3019
@dominikwasiewicz3019 2 года назад
I love you
Далее
How to Implement a Tree in C
14:39
Просмотров 92 тыс.
Happy 4th of July 😂
00:12
Просмотров 5 млн
The purest coding style, where bugs are near impossible
10:25
Learn Binary search trees in 20 minutes 🔍
20:25
Просмотров 145 тыс.
Jonathan Blow on computer science curriculum
8:36
Просмотров 82 тыс.
C++ vs Rust: which is faster?
21:15
Просмотров 380 тыс.
10.1 AVL Tree - Insertion and Rotations
43:08
Просмотров 1,1 млн
Premature Optimization
12:39
Просмотров 767 тыс.
S-Pen в Samsung достоин Золота #Shorts
0:38