19928/jj_containers/jj_minimum_priority_queue.e
Jocelyn Fiat 6dde6425c2 init
2024-06-17 09:09:33 +02:00

49 lines
820 B
Plaintext

note
description: "[
A priority queue implemented as sorted lists, but giving
the minimum value instead of, like Eiffel Software's class,
the maximum value.
]"
author: "Jimmy J. Johnson"
date: "11/11/21"
copyright: "Copyright (c) 2021, Jimmy J. Johnson"
license: "Eiffel Forum v2 (http://www.eiffel.com/licensing/forum.txt)"
class
JJ_MINIMUM_PRIORITY_QUEUE [G -> COMPARABLE]
inherit
LINKED_PRIORITY_QUEUE [G]
redefine
item,
remove
end
create
make,
make_from_iterable
create {JJ_MINIMUM_PRIORITY_QUEUE}
make_sublist
feature -- Access
item: G
-- Item at bottom of queue (i.e. smallest value)
do
Result := i_th (1)
end
feature -- Removal
remove
-- Remove item of highest value.
do
go_i_th (1)
Precursor {LINKED_PRIORITY_QUEUE}
go_i_th (1)
end
end