Skip to content

Commit 9c44e70

Browse files
author
axptwig
committed
Update README.md
1 parent 93dc8b9 commit 9c44e70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Red Black Trees/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Red Black Tree
2-
![fig1](Images/fig1.png)
2+
![fig1](files/fig1.png)
33
Red-black trees are an evolution of binary search trees that aim to keep the tree balanced without affecting the complexity of the primitive operations. This is done by coloring each node in the tree with either red or black and preserving a set of properties that guarantee that the deepest path in the tree is not longer than twice the shortest one.
44
## Motivation:
55
* We want a balanced binary search tree
@@ -28,7 +28,7 @@ Since an insertion or deletion may violate one of the invariant's of the red-bla
2828

2929
#Rotation
3030
To ensure that its color scheme and properties don’t get thrown off, red-black trees employ a key operation known as rotation. Rotation is a binary operation, between a parent node and one of its children, that swaps nodes and modifys their pointers while preserving the inorder traversal of the tree (so that elements are still sorted). There are two types of rotations: left rotation and right rotation. Left rotation swaps the parent node with its right child, while right rotation swaps the parent node with its left child.
31-
![fig2](Images/fig2.png)
31+
![fig2](files/fig2.png)
3232
###Left-Rotation:
3333
```c++
3434
y ← x->right

0 commit comments

Comments
 (0)