Graph Connectedness Explained: Connected Strongly Connected and Weakly Connected

Graph Connectedness Explained: Connected Strongly Connected and Weakly Connected

This video explains graph connectedness for both undirected and directed graphs. For undirected graphs a connected graph means every node can reach every other node through a path. Disconnected graphs have nodes that cannot reach others and may contain separate subgraphs. For directed graphs the terms change to strongly connected where every node reaches every other node following edge directions and weakly connected where the graph is connected if directions are ignored. Step by step examples show how adding edges turns a graph from not connected to weakly connected and finally to strongly connected.
AVL Tree Rotation Types Explained for Self-Balancing Binary Search Trees

AVL Tree Rotation Types Explained for Self-Balancing Binary Search Trees

In AVL trees, when we find a node with a balance factor of 2 or worse, we perform rotations on the trinode subtree. There are four input patterns that all resolve to the same balanced output pattern through single or double rotations. Single rotations handle straight line imbalances while double rotations address the zigzag cases. Each rotation rearranges parent-child pointers to reduce the height from 3 to 2, helping keep the overall tree balanced for log time operations.
AVL Tree Tutorial: Balance Factors and Why They Fix Slow BSTs

AVL Tree Tutorial: Balance Factors and Why They Fix Slow BSTs

AVL trees are self-balancing binary search trees that prevent the tree from becoming unbalanced. We compute balance factors as the absolute value of left subtree height minus right subtree height. If any node has a balance factor of 2 or worse, we rebalance using rotations on trinode subtrees. This keeps search, insert, and other operations efficient at logarithmic time.
How to Search in a Binary Search Tree (BST) โ€“ Step by Step Explanation with Examples

How to Search in a Binary Search Tree (BST) – Step by Step Explanation with Examples

Learn how to search in a Binary Search Tree. We demonstrate searching for existing and non-existing values, explain why BST search is O(log n) on average, and show how poor data ordering can turn your tree into a slow linear structure similar to a linked list. Includes discussion of tree height and balanced vs unbalanced BSTs.