00:00 Representation of Binary Tree
00:37 Class Representation in JAVA
02:05 Representing above tree using Nodes
class Node {
int key;
Node left, right;
// constructor
Node(int key)
{
this.key = key;
this.left = null;
this.right = null;
}
}
Above Binary Tree representation
Node root = new Node(1);
root.left = new Node(2);
root.right = new Node(4);
root.left .left = new Node(3);
root.left.right = null; //No need to assign null its by default null
root.right .left = new Node(7);
root.right .right = new Node(7);
----------------------------------------------------------------------------------------------------------------------------------------------------Playlists
Data Structure & Algorithm | Binary Tree : • Data Structure & Algorithm | Binary Tree
Data Structure & Algorithm | Array : • Data Structure & Algorithm | Array
Data Structure & Algorithm | Heap : • Data Structure & Algorithm | Heap
---------------------------------------------------------------------------------------------------------------------------------------------------- Watch video in 1.25x for better experience..
Please do like, comment, subscribe and share :)
#dsa #binarytree #algorithm #interview #placements #productbased #java #pointers
Mentor : Vijay Dhakad
LinkedIn - / vijay-dhakad-476377169
Instagram - / dhakad_vj
Facebook - / vijay.dhakad.7773
On this page of the site you can watch the video online L2.2 Representation of Binary Tree | Pointers | Binary Tree | Data Structures & Algorithms with a duration of hours minute second in good quality, which was uploaded by the user SYSTEMwithEase 09 November 2022, share the link with friends and acquaintances, this video has already been watched 107 times on youtube and it was liked by 9 viewers. Enjoy your viewing!