AVL Trees in JavaScript For Beginners

Published: 04 June 2021
on channel: NoobCoder
2,991
79

In this tutorial, we are going to be going over a AVL Tree, within JavaScript. An Avl tree, is a height balanced tree. A height balance tree, is a tree in which no 2 subtrees within a tree, differ in height, by more than 1. By keeping our tree balanced this will make up lookup times faster, since within a binary search tree, the tree can eventually be skewed towards the left or right side. An Avl tree maintains this height balance, by using rotations. Its decided which rotation to use based on the balance factor of the node. Which is just the height of the left subtree - right subtree. Within the video, we'll go over the 4 cases in which a rotation would occur.

NoobCoder.com

Source Code:
https://github.com/noobcoder1137/data...

Time Stamps:

0:00 : intro
0:20 : Skewed BST
0:41 : What is a Height Balanced Tree, Height Definitions
1:16 : Example of Height Balanced Trees
2:50 : Balance Factors Definition
3:39 : Calculating Balance Factor Examples
7:09 : Problem: Left-Left Case, Solution: Right Rotation
9:13 : Problem: Right-Right Case, Solution: Left Rotation
10:30 : Problem : Left-Right Case, Solution : Left Rotate then Right Rotate
12:28 : Problem : Right-Left Case, Solution : Right Rotate then Left Rotate
14:16 : Left-Left Case : Handling Subtrees When Rotating
14:51 : Right-Right Case : Handling Subtrees When Rotating
15:15 : Left-Right Case : Handling Subtrees When Rotating
15:54 : Right-Left Case : Handling Subtrees When Rotating
16:36 : AVL Constructors Code
17:15 : Utility MethodsCode : getHeight, getBalance
17:41 : Left Rotate Code
18:24 : Right Rotate Code
18:55 : Insertion Code Overview
23:41 : Insertion Code Walk Through Example
28:27 : Deletion Code Overview
30:42 : Deletion Code Walk Through Example


On this page of the site you can watch the video online AVL Trees in JavaScript For Beginners with a duration of hours minute second in good quality, which was uploaded by the user NoobCoder 04 June 2021, share the link with friends and acquaintances, this video has already been watched 2,991 times on youtube and it was liked by 79 viewers. Enjoy your viewing!