We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3481a67 commit 5b25870Copy full SHA for 5b25870
1 file changed
lib/pqueue.rb
@@ -17,6 +17,9 @@
17
#
18
class PQueue
19
20
+ #
21
+ VERSION = "2.0.0" #:erb: VERSION = "<%= version %>"
22
+
23
24
# Returns a new priority queue.
25
@@ -148,12 +151,10 @@ def concat(elements)
148
151
149
152
alias :merge! :concat
150
153
- # TODO: rename #pop_array or support n argument #pop itself.
-
154
155
# Return top n-element as a sorted array.
156
- def pop_array(n=@size)
157
+ def take(n=@size)
158
a = []
159
n.times{a.push(pop)}
160
a
0 commit comments