Binary Tree 1. Constructing a tree (algorithm and pseudocode)

preview_player
Показать описание
This is the first in a series of videos about binary trees. It is an explanation of the dynamic data structure known as the Binary Tree. It describes the way in which a binary tree is constructed, and how it can be represented numerically using a system of left and right pointers. This video goes on to describe some pseudocode which takes an iterative approach to constructing a binary tree using 3 array variables.
Рекомендации по теме
Комментарии
Автор

I paid $8600 for a bootcamp course and I've learned more from your channel for free.
Honestly you've saved my career as a programmer because I was beginning to think I'm just not smart enough to get these concepts. But I was wrong, I just wasn't being taught properly. I understand this stuff really easily with proper explanation.

KuntaKinteToby
Автор

Damn, my code looked exactly like your pseudocode, except in one place: instead of using the pointers to the elements in the array/data structure whose elements you use to form the tree, I dynamically allocated memory everytime I needed it. Learnt a lot about pointers and dynamic memory allocation along the way!

jibran
Автор

Such simple explanations, thank you so much

filzapk
Автор

There is only one question left... What is it used for and why do you need something like this?

Nanagos
Автор

JavaScript guy here - haven't worked with trees - the result looked like a mess to me (i.e. despite a lot of comparisons the tree isn't sorted such that you could easily find stuff) - is this really somehow more efficient for some things?

JulianSloman
Автор

Do you have any advice of how to learn these ADTs quickly? I have my A levels exam (CIE 9608 P4) in one month and I left data structures last and I shouldn't have done that. (You have the best explanations on the internet btw)

roasted_guava
Автор

Is this a Binary Tree or Binary Search Tree? As per my understanding, this should be a binary search tree since the data is being assigned according to rules. Can you please confirm?

umer
Автор

What happens if you have two nodes with the same value?

RyanGrange
Автор

So terminal nodes can also mean infertile, yes? XD

DXRB
Автор

I get the urge to reimpplement this lesson in code, use all of the Harry Potter cast and then see who comes out on top.

Root
Автор

Hi, are the 3 array variables defined in the form of a record? Then the array is is defined as Type record?

barrydevine
Автор

I didn't the ptr part?
Explain me the line "Do until ptr = 0"?

armeenhossain
Автор

nice content. although I don't like the pseudocode. I code in python, java and cpp but still, your pseudocode looks like a Frankenstein's monster to me.

ememmeme