Priority queue: Difference between revisions
m
→Using a stack with pointers to Groups as elements
Line 4,681:
<syntaxhighlight lang="m2000 interpreter">
global countmany=0&
class obj {
Line 4,722 ⟶ 4,721:
Header()
while not @isEmpty(b)
//Print @Pop(b)=>tostring$
checkme(@Pop(b))
end while
ObjectCount()
Line 4,741:
push n
local t=2, b=len(a)
t1=m
m=(b+t) div 2
Line 4,763:
end function
Function Pop(a)
// Group make a copy
stack a {=Group}
end function
sub checkme(a as *obj)
Print a=>tostring$
end sub
}
PriorityQueueForGroups
|