Binary Tree
Binary Tree
TREE
DR. MD. ASRAF ALI
ASSOCIATE PROFESSOR DPT. OF SWE
WHAT IS BINARY TREE ?
{
p : = new tree node //here new tree node means create a node such
(p → Lchild)= 0 ; (p → data)= x ; (p → Rchild)= 0 ;
if(tree ≠ 0 ) {
if(x < (q-data) ) {
q → Lchild : = p ;
}
else {
q → Rchild : = p ;
}
}
else {
tree : = p // if tree is null then here create root of a tree
}
}
//Back to previous slide.
THE END