- Suppose θ = 0.2
- Input:
1 2 4 3 4 7 8 4 8 4 4 9 15 4 8 1 4 8 15 4 98 4 765 4 9825 8 2 4 8 4 2 ...
|
- Execution of the algorithm:
1/θ = 1/(0.2) = 5
Delete phase is activated when |K| = 6 items
Process items until |K| = 6:
1 2 4 3 4 7 8
After insert phase:
(1, 1), (2, 1), (4, 2), (3, 1) (7, 1) (8, 1) (6 items)
Delete phase decrement count by 1:
(1, 0), (2, 0), (4, 1), (3, 0) (7, 0) (8, 0)
After delete items with 0 count:
(4, 1)
Process items until |K| = 6:
4 8 4 4 9 15 4 8 1 4 8 15 4 98
After insert phase:
(4, 8), (8, 3), (9, 1), (15, 1) (1, 1) (98, 1) (6 items)
Delete phase decrement count by 1:
(4, 7), (8, 2), (9, 0), (15, 0) (1, 0) (98, 0)
After delete items with 0 count:
(4, 7), (8, 2)
Process items until |K| = 6:
4 765 4 9825 8 2 4 8 4 2 7
After insert phase:
(4, 12), (8, 5), (765, 1), (9825, 1) (2, 2) (7, 1) (6 items)
Delete phase decrement count by 1:
(4, 11), (8, 4), (765, 0), (9825, 0) (2, 1) (7, 0)
After delete items with 0 count:
(4, 11), (8, 4), (2, 1)
|
|