Fix for heap_pop() test in arrays
This commit is contained in:
parent
8df0cc41c9
commit
2fcf1939bb
@ -105,16 +105,16 @@ func main():
|
|||||||
>> heap:heapify()
|
>> heap:heapify()
|
||||||
>> heap
|
>> heap
|
||||||
sorted := @[:Int]
|
sorted := @[:Int]
|
||||||
while heap.length > 0:
|
repeat:
|
||||||
sorted:insert(heap:heap_pop())
|
sorted:insert(heap:heap_pop() or stop)
|
||||||
>> sorted == sorted:sorted()
|
>> sorted == sorted:sorted()
|
||||||
= yes
|
= yes
|
||||||
for _ in 10:
|
for _ in 10:
|
||||||
heap:heap_push(random:int(1, 50))
|
heap:heap_push(random:int(1, 50))
|
||||||
>> heap
|
>> heap
|
||||||
sorted = @[:Int]
|
sorted = @[:Int]
|
||||||
while heap.length > 0:
|
repeat:
|
||||||
sorted:insert(heap:heap_pop())
|
sorted:insert(heap:heap_pop() or stop)
|
||||||
>> sorted == sorted:sorted()
|
>> sorted == sorted:sorted()
|
||||||
= yes
|
= yes
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user