See complete series on data structures here:

In this lesson, we have discussed binary tree in detail. We have talked about different types of binary tree like “complete binary tree”, “perfect binary tree” and “balanced binary tree” and their properties. We have also discussed how cost of operations in a tree may depend upon height of the tree and why we want a tree to be dense and its height to be minimum. Finally, we talked about two possible implementations of binary tree – a) using dynamically created nodes and b) using arrays.

For practice problems and more, visit:

Like us on Facebook:

Follow us on twitter:

Nguồn:https://dothihoa.com/

Excellent even after 5 years..Thank you

Why is the height of an empty tree -1? There are no edges, so shouldn't it just be 0?

The height is the maximum depth of a leaf node in the graph! Height and depth can be the same when a node has as many ancestors as descendants 🙂

nice! really helped!

Felt very sad that the guy who was founder of these courses passed away on June 2014 . in a car accident! but he is alive with his videos!!! RIP !! 🙁

When to use log(n+1) -1 and when to use log(n) , What is the difference between two.

Your Voice is very clear but have some example while explaining this Tree mathematics, also slow down in between,don’t run away with all the lecture

in a complete binary tree … 2:42 " all nodes are as left as possible " what does that mean?

Ty

Question : What do you mean by complete binary tree at 5:18, Do you mean that all L0 – L2 nodes must have 2 children, or do you mean numerical fulfillment of nodes?

amazing content, really loved it 🙂

This is a great video. Just had one doubt, i understood we consider height of node as 0 if there are no child nodes and height of tree as -1 if there is no root. However, around 13th minute we considered tree with no child nodes with height -1(instead of 0), also made height of left sub-tree as 1(instead of 2).

@13:08 How is the height of left sub tree -1? I think it should be 2, right?

tq

Can u plz upload video for binary tree delete operation. Not binary search tree.

Subtitles are giving problem please improve understand

S

Some definitions / references :

https://stackoverflow.com/questions/2603692/

thanks to making such a nice tutorial it will covers all necessary information to starting binary tree.

thanks again.

perfect . Thank you very much.

Thanks a lot for this data structure playlist! A life saver if u ask me..

I know I know i'm pretty late.. but still thanks again!

can we say that height of a tree with n level would be equal to n-1

plz tell me

At 6:25 h+1 = levels ? levels and height are diffrent and how h+1 = levels

Fuck dis accent. But thankful

Excellent Explanation <3

Great lesson. Very good!

Best lecture on a binary tree so far.

Ur videos r awesome………. But one simple request……..can u plz put that subtitles little down coz we can't see what is written on bottom of the board

Great video but I would recommend going a little slower. The math is important and I think you went too fast on those parts. Thanks for the good work!

Who are the 160 f**king dislikers of this video?

WoW….very nice video

Thanks

If anyone is having confusion between depth and height, think of the analogy that we measure the 'depth' of sea from it's surface and the 'height' of a person from toe to head.

I didn't understand the height of the subtree ..according to me it was two as u described at 13:05 min ..as you previously said ..Height is the longest path from Node x to leaf ..and if you are counting from the root then what is the difference between depth and height ..oh God …its so confusing 🙂

Quick question. What is the difference between BST and AVL?

Did anyone notice him saying 1th, 2th? Kind of a funny brainfreeze. Anyways, nice tutorial. Thank you. 👍

Your tutorials are just awesome man.

Dude height means no.of edges from node to the farthest leaf node??? But you are taking height as 1 from root to its child. is it correct?

Thnqq u sir ,this video is very usefullll,,thnqqqq uuuu soooooo muchhhhhhhhhhh☺☺

anybody watching this in 2019

an empty tree does not exist, what is meant instead is a leaf tree

Based on this it would be safe to assume that using timestamp based primary keys is not a good idea in mysql? It uses b-trees for storing indexes. With id based indices you are essentially constantly building a linked list that mysql has to rebalance in the background. On a very hot table this would result in a lot of extra work necessary to keep read speed reasonable.

your are very clever and accurate person

Sir,Can you upload the videos of AVL Trees,B-Trees,B+ Trees,Heap ,Radix Sort ?

Great stuff

thank you sir

Hands down best videos on the net for Data Structure. Awesome work man.

anybody watching in 2018

Is that array implementation suitable for only perfect binary trees or is it suitable for complete binary trees too ?

@mycodeschool Awesome work