Professional Documents
Culture Documents
Appendix-Young Tableaus
Appendix-Young Tableaus
A. Kostanyan
1
Young Tableaus
The Young tableau is a quadratic table filled with keys
and the value so that
may appear only at last column/row,
the keys in each column/row follow in non-
decreasing order.
Example:
5 15 20 50
10 25 40
30 45 55
35 60
min(S);
To retrieve the smallest key from a Young tableau representing the
set S, it suffices to get the key in the left upper position of the table.
The operation takes O(1) time.
min()
5 20 30 35
10 25 40
15 45 50
A. Kostanyan
3
Operations – (2)
extractMin(S);
To extract a minimum key from a Young tableau representing the set
S, it suffices to write the last finite key taken from either last row or
last column in the left upper position, write in the previous position
of that key and restore the tableau property in the following way:
Current key is repeatedly compared with existing neighbors on the
right and below, and these keys are swapped if the tableau property is
violated.
The operation takes O(n) complexity.
Example:
5 15 20 50 10 15 20 50
extractMin()
10 25 45 25 40 45
30 40 55 30 55 60
35 60 35
A. Kostanyan
4
Operations – (3)
insert(S, x);
To insert the key x into a Young tableau representing the set S with
at least one , it suffices to write x after the last finite key in either
last row or last column and restore the tableau property as follows:
Current key is repeatedly compared with existing neighbors on the
left and above, and these keys are swapped if the tableau property is
violated.
The operation takes O(n) time.
Example:
5 15 20 50 5 15 20 50
insert(7)
10 25 45 7 25 45
30 40 55 10 30 55
35 60 35 40 60
A. Kostanyan
5
Operations – (5)
decreaseKey(S, x, k);
We assume in this operation that x is given as a position in a Young
tableau representing the set S . To reduce the key in position x by
making it equal to k, it suffices to write k in position x and restore the
tableau property in the following way:
Current key is repeatedly compared with existing neighbors on the
left and above, and these keys are swapped if the tableau property is
violated.
The operation has O(n) complexity.
Example:
5 15 20 50 5 15 20 50
decreaseKey(60, 11)
10 25 45 10 25 45
30 40 55 11 30 55
35 60 35 40
A. Kostanyan
6
Conclusion
A. Kostanyan
7
Young Tableau vs. Binary Heap
Binary heap Young tableau
implementation implementation
Note: Despite the fact that the Young tableau compared to the binary heap provides
a worse implementation for the priority queue operations, however it efficiently
maintains a wider set of operations such as getting the maximum value or searching
for an arbitrary key (see next slide).
A. Kostanyan
8
Additional Operations
The Young tableau provides O(1)-time implementation
for the operation of getting the maximum key, and O(n)-
time implementation for the operation of searching for an
arbitrary key:
5 15 20 50 5 15 20 50
10 25 40 10 25 45 65
30 45 55 30 40 55 70
35 60 35 60 75 80
A. Kostanyan
9