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
На этой странице сайта вы можете посмотреть видео онлайн L2.2 Representation of Binary Tree | Pointers | Binary Tree | Data Structures & Algorithms длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь SYSTEMwithEase 09 Ноябрь 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 107 раз и оно понравилось 9 зрителям. Приятного просмотра!