pairing_heap 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/Rakefile +1 -1
- data/lib/pairing_heap/version.rb +1 -1
- data/sig/pairing_heap.rbs +7 -7
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0c7122d09fdfbcda744f2824df424af7634b2497594ecda22ec08a24b1372a91
|
|
4
|
+
data.tar.gz: 6e2a075da8593426c0bd893594d01bc3434036af94ca607cd6c1613fc9900272
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b24f2b9386d50527877e19f1de73dfef77258ff2f9051704c33c7d3a93610322b67f7467ae85113870ce45246e63d282e97102bd98ce10978f0297858c2fd50e
|
|
7
|
+
data.tar.gz: abf622d8f59d67cdcf65fd6e96564877929e9a8979df5f98d417141ce2d3040d41a483f2f4abedb86e4bbcee832260714131f07f665563a035cfb18b33c1ff3e
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pairing_heap (3.1.
|
|
4
|
+
pairing_heap (3.1.3)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
@@ -102,7 +102,7 @@ CHECKSUMS
|
|
|
102
102
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
|
103
103
|
logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
|
|
104
104
|
minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1
|
|
105
|
-
pairing_heap (3.1.
|
|
105
|
+
pairing_heap (3.1.3)
|
|
106
106
|
parallel (1.27.0) sha256=4ac151e1806b755fb4e2dc2332cbf0e54f2e24ba821ff2d3dcf86bf6dc4ae130
|
|
107
107
|
parser (3.3.10.0) sha256=ce3587fa5cc55a88c4ba5b2b37621b3329aadf5728f9eafa36bbd121462aabd6
|
|
108
108
|
prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
|
data/Rakefile
CHANGED
data/lib/pairing_heap/version.rb
CHANGED
data/sig/pairing_heap.rbs
CHANGED
|
@@ -25,7 +25,7 @@ module PairingHeap
|
|
|
25
25
|
|
|
26
26
|
# Returns the element and its priority at the top of the heap.
|
|
27
27
|
# Time Complexity: O(1)
|
|
28
|
-
def peek_with_priority: () -> [Elem, Priority] | [nil, nil]
|
|
28
|
+
def peek_with_priority: () -> ([Elem, Priority] | [nil, nil])
|
|
29
29
|
|
|
30
30
|
# Time Complexity: O(1)
|
|
31
31
|
def empty?: () -> bool
|
|
@@ -48,7 +48,7 @@ module PairingHeap
|
|
|
48
48
|
|
|
49
49
|
# Removes element from the top of the heap and returns it along with its priority.
|
|
50
50
|
# Time Complexity: O(N), Amortized: O(log N)
|
|
51
|
-
def pop_with_priority: () -> [Elem, Priority] | [nil, nil]
|
|
51
|
+
def pop_with_priority: () -> ([Elem, Priority] | [nil, nil])
|
|
52
52
|
|
|
53
53
|
# Changes a priority of element to a more prioritary one.
|
|
54
54
|
# Time Complexity: O(1), Amortized: O(log N)
|
|
@@ -73,7 +73,7 @@ module PairingHeap
|
|
|
73
73
|
|
|
74
74
|
# Returns [false, nil] if the element is not in heap, [true, priority] if it is.
|
|
75
75
|
# Time Complexity: O(1)
|
|
76
|
-
def get_priority_if_exists: (Elem elem) -> [false, nil] | [true, Priority]
|
|
76
|
+
def get_priority_if_exists: (Elem elem) -> ([false, nil] | [true, Priority])
|
|
77
77
|
|
|
78
78
|
# Yields each element in the heap. No order guarantees.
|
|
79
79
|
def each: () { (Elem) -> void } -> void
|
|
@@ -105,7 +105,7 @@ module PairingHeap
|
|
|
105
105
|
|
|
106
106
|
# Returns the element and its priority at the top of the heap.
|
|
107
107
|
# Time Complexity: O(1)
|
|
108
|
-
def peek_with_priority: () -> [Elem, Priority] | [nil, nil]
|
|
108
|
+
def peek_with_priority: () -> ([Elem, Priority] | [nil, nil])
|
|
109
109
|
|
|
110
110
|
# Time Complexity: O(1)
|
|
111
111
|
def empty?: () -> bool
|
|
@@ -128,7 +128,7 @@ module PairingHeap
|
|
|
128
128
|
|
|
129
129
|
# Removes element from the top of the heap and returns it along with its priority.
|
|
130
130
|
# Time Complexity: O(N), Amortized: O(log N)
|
|
131
|
-
def pop_with_priority: () -> [Elem, Priority] | [nil, nil]
|
|
131
|
+
def pop_with_priority: () -> ([Elem, Priority] | [nil, nil])
|
|
132
132
|
|
|
133
133
|
# Yields each element in the heap. No order guarantees.
|
|
134
134
|
def each: () { (Elem) -> void } -> void
|
|
@@ -146,7 +146,7 @@ module PairingHeap
|
|
|
146
146
|
end
|
|
147
147
|
|
|
148
148
|
# Priority queue where the smallest priority is the most prioritary
|
|
149
|
-
class MinPriorityQueue[Elem, Priority < Comparable
|
|
149
|
+
class MinPriorityQueue[Elem, Priority < Comparable] < PairingHeap[Elem, Priority]
|
|
150
150
|
def initialize: () -> void
|
|
151
151
|
|
|
152
152
|
alias decrease_key change_priority
|
|
@@ -155,7 +155,7 @@ module PairingHeap
|
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
# Priority queue where the highest priority is the most prioritary
|
|
158
|
-
class MaxPriorityQueue[Elem, Priority < Comparable
|
|
158
|
+
class MaxPriorityQueue[Elem, Priority < Comparable] < PairingHeap[Elem, Priority]
|
|
159
159
|
def initialize: () -> void
|
|
160
160
|
|
|
161
161
|
alias increase_key change_priority
|