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

preview_player
Показать описание
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️

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.

I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
It is a powerful, secure text editor designed specifically for programmers.

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.

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)

You can also follow me on other platforms:
Рекомендации по теме
Комментарии
Автор

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
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 <iostream>
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();
}

CodeBeauty
Автор

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.

mackenziejackson
Автор

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 YouTube 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.🤝👏👏

yangamasibulelemdede
Автор

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

phantomghoul
Автор

The timing of this video is perfect. Just started learning this in university. Now I can learn ahead and show off next class xD

mr.potato
Автор

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!

bldspec
Автор

Your videos are the most helpful on data structure foundations and c++ that I’ve found on all of YouTube. Thank you!
Could you do a video of black red trees

jovanaycart
Автор

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 YouTube.

Thank you 💖

granumuse
Автор

I’m currently in a Data Structures class at my university. When we got to trees, that’s when this video was uploaded 🤯

crazyzombie
Автор

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#?

BunnyHuggerr
Автор

I come straight to your page for every new week of content in my C++ class. Thank you!

JovanayCarter
Автор

if the children are connected it would be a graph data structure instead of tree

abdelmalek
Автор

Very clear explanation for binary tree c++ implementation

leoleo
Автор

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?

Sportsman
Автор

Yo I’m literally working on a project in class for this!!! Perfect timing

Rebel
Автор

Just going through DSA and this is helpful.

techymoh
Автор

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.

mindlessmeat
Автор

Your videos are so helpful. Thank you!

MarcusHCrawford
Автор

please make a video on UML DIAGRAMS as soon as possible

dileep.b
Автор

You are indeed, the teacher every student dreams of...😂

davronxonmuxamedaliyev
join shbcf.ru