You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Splay Tree/readme.md
+24-2Lines changed: 24 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,25 @@ Splay tree is a data structure, structurally identitical to a Balanced Binary Se
8
8
9
9
Given a node *a* if *a* is not the root, and *a* has a child *b*, and both *a* and *b* are left children or right children, a **Zig-Zig** is performed.
10
10
11
+

12
+
13
+

14
+
11
15
### Zig-Zag
12
16
13
17
Given a node *a* if *a* is not the root, and *a* has a child *b*, and *b* is the left child of *a* being the right child (or the opporsite), a **Zig-Zag** is performed.
14
18
19
+

20
+
21
+

22
+
15
23
### Zig
16
24
17
25
A **Zig** is performed when the node *a* to be rotated has the root as parent.
18
26
27
+

28
+
29
+
19
30
## Splaying
20
31
21
32
## Operations
@@ -30,9 +41,20 @@ A **Zig** is performed when the node *a* to be rotated has the root as parent.
30
41
31
42
### Example 1
32
43
44
+

45
+
46
+

47
+
48
+

49
+
50
+
33
51
### Example 2
34
52
35
-
### Example 3
53
+

54
+
55
+

56
+
57
+

36
58
37
59
## Advantages
38
60
@@ -57,4 +79,4 @@ With *n* being the number of items in the tree.
57
79
[Splay Tree on Wikipedia](https://en.wikipedia.org/wiki/Splay_tree)
58
80
[Splay Tree by University of California in Berkeley - CS 61B Lecture 34](https://www.youtube.com/watch?v=G5QIXywcJlY)
59
81
60
-
*Written for Swift Algorithm Club by Mike Taghavi and Matthijs Hollemans*
82
+
*Written for Swift Algorithm Club by Barbara Martina Rodeker*
0 commit comments