Java Collections - Visualizing Red-Black Tree | Java Tutorial Part 1 #027

preview_player
Показать описание
In this video, we will see how java maintains a binary search tree (Red-Black) in the TreeSet collection. We will also explore how it keeps the binary search tree balanced. Note, the balanced binary search tree is also called Red-Black tree.

Here, we place code in the compareTo method to visualize the Red-Black Tree behind the Java TreeSet collection.

00:00 Introduction
00:50 Binary Tree and TreeSet
02:15 Binary Tree Explanation
04:30 Binary Search Tree
12:33 Red-Black Tree
18:20 Adding Element to Red-Black Tree
24:05 Demo - Adding Random Elements
36:58 Demo - Balancing the Tree
Рекомендации по теме
visit shbcf.ru