Priority queue: Difference between revisions

No edit summary
Line 2,699:
 
===Using a stack with Groups as elements===
this the same as previous but now we use a group (a user object for M2000). InsertPQ is the same as before. Lambda comp has change only. We didn't use pointers to groups. All groups here works as values, so when we get a peek we get a copy of group in top position. All members of a group may not values, so if we have a pointer to group then we get a copy of that pointer, but then we can make changes and that changes happen for the group which we get the copy.
 
<lang M2000 Interpreter>
Module PriorityQueueForGroups {
Anonymous user