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

  Рет қаралды 87,354

CodeBeauty

CodeBeauty

Күн бұрын

Пікірлер: 219
@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(); }
@mehdisanjaghi292
@mehdisanjaghi292 3 ай бұрын
do you have an algorithm to unmerge/split a tree?
@mackenziejackson2888
@mackenziejackson2888 2 жыл бұрын
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 2 жыл бұрын
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
@yangamasibulelemdede4191
@yangamasibulelemdede4191 2 жыл бұрын
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 KZbin 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 2 жыл бұрын
I appreciate this so much 💓
@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!! ✨✨
@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!
@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!
@JovanayCarter
@JovanayCarter Жыл бұрын
I come straight to your page for every new week of content in my C++ class. Thank you!
@jovanaycart
@jovanaycart Жыл бұрын
Your videos are the most helpful on data structure foundations and c++ that I’ve found on all of KZbin. Thank you! Could you do a video of black red trees
@gowthamkumars365
@gowthamkumars365 Ай бұрын
Thank you CodeBeauty, Your videos are helping to brush-up the things.... Concise and precise.... Please enable the audio of last one min...
@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 KZbin. Thank you 💖
@Rebel084
@Rebel084 2 жыл бұрын
Yo I’m literally working on a project in class for this!!! Perfect timing
@leoleo20100216
@leoleo20100216 Жыл бұрын
Very clear explanation for binary tree c++ implementation
@techymoh
@techymoh 2 жыл бұрын
Just going through DSA and this is helpful.
@abdelmalek9004
@abdelmalek9004 Жыл бұрын
if the children are connected it would be a graph data structure instead of tree
@CodeBeauty
@CodeBeauty Жыл бұрын
Yess 😁
@rmt3589
@rmt3589 10 ай бұрын
Thank you so much! It's what I'm actually looking for!
@MarcusHCrawford
@MarcusHCrawford 6 ай бұрын
All trees are graphs.
@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 !
@Sportsman134
@Sportsman134 2 жыл бұрын
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
@MarcusHCrawford
@MarcusHCrawford 6 ай бұрын
Your videos are so helpful. Thank you!
@CodeBeauty
@CodeBeauty 6 ай бұрын
I'm glad to hear that! 🥰
@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.
@ngongocnam4239
@ngongocnam4239 5 ай бұрын
I love you. My teacher ❤. You was explained clearly and easy to understand what things you wanna share to others
@luisalamo2658
@luisalamo2658 2 жыл бұрын
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.
@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
@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.
@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 ❤
@suhas5605
@suhas5605 2 жыл бұрын
Please complete data structures as soon as possible with all topics covered...
@TonyStark-lw7lv
@TonyStark-lw7lv 2 жыл бұрын
Thanks for starting this topic. Waited for this 🤝🏻. Thank You Again.
@DRdr123
@DRdr123 2 жыл бұрын
Thank you 😊 from Egypt
@G_.G_.G
@G_.G_.G 6 ай бұрын
Really thankyou for this video This video clear my doubt which I have been searching for few hours.
@railway-trainstramssubways1584
@railway-trainstramssubways1584 2 жыл бұрын
Greetings from nearby Bulgaria! Great video! Currently studying c++ programming in the university and your videos help a lot!
@mariacunha8508
@mariacunha8508 Жыл бұрын
I really appreciate this videos!!! Thank you so so much!
@E_sharp17
@E_sharp17 Жыл бұрын
you are a blessing
@PreludeSon
@PreludeSon 2 жыл бұрын
This is such a great tutorial...the pictorial truly help.
@asthajain7207
@asthajain7207 2 жыл бұрын
Now I started understanding things better by your video could you please upload a video on a circular linked list...... ♥️♥️
@qhamanisobisho7962
@qhamanisobisho7962 Ай бұрын
Video sound cuts at 14:25 🥲very helpful though❤
@CodeBeauty
@CodeBeauty Ай бұрын
I'm sorry, this is likely due to KZbin's copyright rules. The algorithm probably misinterpreted my audio as something that shouldn't be part of the video, which is obviously a mistake because the video is perfectly fine and two years old. Considering it has 82k views and yours is the first comment of this type, I'm guessing this issue happened recently.
@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. 🥰
@sikirusalau9460
@sikirusalau9460 2 жыл бұрын
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.
@davronxonmuxamedaliyev4377
@davronxonmuxamedaliyev4377 8 ай бұрын
You are indeed, the teacher every student dreams of...😂
@dileep.b5054
@dileep.b5054 2 жыл бұрын
please make a video on UML DIAGRAMS as soon as possible
@birger928
@birger928 2 жыл бұрын
Thank you! You are great! 👏🏼
@UnrealCatDev
@UnrealCatDev Жыл бұрын
Very gut video
@adilkayani
@adilkayani 2 жыл бұрын
This lady is a codebeauty and a real beauty. )) And funny too. )) I mean, she has a great sense of humor.
@Edxylom
@Edxylom 2 жыл бұрын
I love Saldina I was need this video! a Video explain Hash Tables will be amazin!!
@mahmoudhagag4234
@mahmoudhagag4234 2 жыл бұрын
Welcome back, we missed you💙
@orangeeezoe
@orangeeezoe 2 жыл бұрын
Is that the graph data structure for the closed loop?
@_Omni
@_Omni 2 жыл бұрын
Yes
@nguyenviet908
@nguyenviet908 2 жыл бұрын
thank you very much, wishing you all the best!
@ehapahmed1069
@ehapahmed1069 7 ай бұрын
will it differ if I used class instead of struct ?
@CodeBeauty
@CodeBeauty 7 ай бұрын
Nope, but there is one important difference between class and structure. Do you know what it is? 😃
@peterchisangamwamba9100
@peterchisangamwamba9100 2 жыл бұрын
thanks patiently waiting for the next video on trees
@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! 💜💜
@remimonsel9944
@remimonsel9944 4 ай бұрын
Hello, I watched the liked lists videos you created and in there when creating a Node, you created a class and here it's a struct for the node. Is there a reason why not using class as well here ? or we can use one or the other it doesn't matter ?
@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 жыл бұрын
❤️❤️
@enesaytekin5827
@enesaytekin5827 3 ай бұрын
You are best Saldina :)
@tryit1568
@tryit1568 2 жыл бұрын
Thanks so much for this !!!! I love these Data Structure Videos Graph Data structures next please 🙏!! ❤️❤️
@aliomidi9613
@aliomidi9613 Жыл бұрын
your teach better than my university professor
@dongyangchen5460
@dongyangchen5460 2 жыл бұрын
they are very helpful, ty!
@julioventura2867
@julioventura2867 5 ай бұрын
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 ?
@leoara8019
@leoara8019 2 жыл бұрын
great video in perfect time...thank you so much for the video.
@mehdisanjaghi292
@mehdisanjaghi292 3 ай бұрын
do you have an algorithm to unmerge/split a 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? 😃👊👍
@infamoustony
@infamoustony 11 ай бұрын
the data structure on 3:35 is graph
@CodeBeauty
@CodeBeauty 11 ай бұрын
Yes 👍🤗
@chiragsawajiyani8540
@chiragsawajiyani8540 2 жыл бұрын
Can you please make a full detail course for c#.
@temirkhanamanbaev42
@temirkhanamanbaev42 2 жыл бұрын
You are great 👍!
@pikimk6167
@pikimk6167 2 жыл бұрын
Graph, and i hope you make a video about graphs 😀
@CodeBeauty
@CodeBeauty 2 жыл бұрын
Yes, correct answer 😃😃
@BantuBeast
@BantuBeast Жыл бұрын
Thank you!
@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
@nagen78
@nagen78 Жыл бұрын
your tutorials are superb and looking forward for similar tutorials in Python
@AwaisKhan-th8fo
@AwaisKhan-th8fo 2 жыл бұрын
Thanks you so much ma'am.
@ajitpatil6532
@ajitpatil6532 2 жыл бұрын
Just about 3 days ago I was trying to find your video for this topic, and today you posted it!
@tarekbenlakri1058
@tarekbenlakri1058 2 жыл бұрын
hey could you answering me what is the difference between NULL and nullptr
@kavyapatel593
@kavyapatel593 2 жыл бұрын
I think the data structure you showed on paint was a graph?
@CodeBeauty
@CodeBeauty 2 жыл бұрын
yes 😃
@ChandanDas-kz5wq
@ChandanDas-kz5wq 4 ай бұрын
Is that structure "doubly circular linked list"?
@tobiluchi911
@tobiluchi911 2 жыл бұрын
Wowww that's what I'll be learning this year! Thanks a lot ;))
@mayabouban379
@mayabouban379 3 ай бұрын
cyclic graph can be represented by a doubly linked list
@mayabouban379
@mayabouban379 3 ай бұрын
Now I'm a 3rd year student in cs and in my first and second year you helped me a lot I'm very thankful for your help after watching your 10 hours tutorial I get 93/100 in my first exam in c++ Thank you so much
@faujayikhsan2194
@faujayikhsan2194 Жыл бұрын
appreciate, thank you so much for this, hope you have a wonderful day
@kamilaarshad5427
@kamilaarshad5427 2 жыл бұрын
why we are using Node * as data type for left and right node
@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 😏😅
@jameskaiser7474
@jameskaiser7474 11 ай бұрын
What do a root node and batman have in common?
@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 : )
@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
@jasonyu7963
@jasonyu7963 2 жыл бұрын
if the child are also connected is it a circular singly linked list?
@178fahimahmed7
@178fahimahmed7 2 жыл бұрын
Yesh, It's a graph in 5:22
@mudkiptheengineer5339
@mudkiptheengineer5339 Жыл бұрын
if I'm not mistaken, the "BST" tree is also called a RedBlack tree
@JorielTejada-te4dd
@JorielTejada-te4dd Жыл бұрын
How about Graph Data Structure? Can You teach us about that algorithm? please?
@Asterics.
@Asterics. 8 ай бұрын
thank you bst 😉
@CodeBeauty
@CodeBeauty 7 ай бұрын
Welcome 😊
@chrishabgood8900
@chrishabgood8900 11 ай бұрын
It’s like double link list?
@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!!
@robertpaukovic6811
@robertpaukovic6811 Жыл бұрын
nullprt was not declared in the scope ??
@anschoudhary1376
@anschoudhary1376 2 жыл бұрын
for 12:07 can we do newNode->left && newNode->right = nullptr;
@hisoka7489
@hisoka7489 8 ай бұрын
So.... what is the data structure in the min 3:46?
@Matice21
@Matice21 Жыл бұрын
I don’t understand newNode->left = newNode ->right = nullptr. Is this just setting both the left & right to null? Is it the same as newNode->left = nullptr newNode->right = nullptr // ?
@dileeshaabilash5562
@dileeshaabilash5562 29 күн бұрын
perfect🔥🔥
@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
@DagiBura
@DagiBura 10 ай бұрын
Your natural beauty truly shines when you're not wearing eyeglasses.
@CodeBeauty
@CodeBeauty 10 ай бұрын
I've spent many nights coding, so I get that's where my bad eyesight comes from. Thank you 🥰 ❤️
@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😁😁
@alexconklin-rn4jd
@alexconklin-rn4jd 6 ай бұрын
3:34 its a cyclically linked list right? :D
@BooleanAutocrats-mc2ny
@BooleanAutocrats-mc2ny Жыл бұрын
They are called circular linked lists
@thealphabetissilent3447
@thealphabetissilent3447 Жыл бұрын
What is the DSt at 6:10?
@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....
@ahmedal_shendidi7925
@ahmedal_shendidi7925 2 жыл бұрын
In the sixth minute the data type is graph
@CodeBeauty
@CodeBeauty 2 жыл бұрын
Yess, correct answer 😃😃
Data structures: Binary Tree
16:17
mycodeschool
Рет қаралды 1,4 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 166 МЛН
How to Implement a Tree in C
14:39
Jacob Sorber
Рет қаралды 100 М.
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
Data structures: Binary Search Tree
19:28
mycodeschool
Рет қаралды 1,3 МЛН
10.1 AVL Tree - Insertion and Rotations
43:08
Abdul Bari
Рет қаралды 1,2 МЛН
10 Important Python Concepts In 20 Minutes
18:49
Indently
Рет қаралды 300 М.
5.1 Tree in Data Structure | Introduction to Trees | Data Structures Tutorials
29:17
Jenny's Lectures CS IT
Рет қаралды 1,4 МЛН
5.3 Binary Tree Implementation in C Program | Data Structures Tutorials
24:37
Jenny's Lectures CS IT
Рет қаралды 887 М.
Learn Binary search trees in 20 minutes 🔍
20:25
Bro Code
Рет қаралды 182 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 6 МЛН