INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

description: "Priority queues implemented as heaps "
title: "EiffelBase: library of reusable components for Eiffel. ", "Based on EiffelBase library for ISE Eiffel, ", "used with permission. "
project: "EiffelBase Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
key: sorted_priority_queue, dispenser, heap
cluster: eiffelbase
class HEAP_PRIORITY_QUEUE [G -> COMPARABLE]
inherit

PRIORITY_QUEUE [G]
undefine
consistent,
copy,
empty,
is_equal,
setup
select
count
end

ISE_ARRAY [G]
rename
make as array_make,
item as i_th,
put as put_i_th,
bag_put as put,
force as array_force,
count as array_count
export
{NONE}
all
{HEAP_PRIORITY_QUEUE}
put_i_th
redefine
extendible,
full,
linear_representation,
prunable,
put
end
creation

make
feature -- Initialization

make (n: INTEGER)
-- Allocate heap space.
feature -- Access

item: G
-- Entry at top of heap.
feature -- Measurement

count: INTEGER
feature -- Status report

extendible: BOOLEAN
-- May items be added?

full: BOOLEAN
-- Is structure filled to capacity?

prunable: BOOLEAN
feature -- Element change

force, put (v: G)
-- Insert item `v' at its proper position.
feature -- Removal

remove
-- Remove item of highest value.
feature -- Conversion

linear_representation: ARRAYED_LIST [G]
-- Representation as a linear structure
-- (Sorted according to decreasing priority)
feature -- Duplication

duplicate (n: INTEGER): like Current
-- New priority queue containing the `n' greatest items
end -- class HEAP_PRIORITY_QUEUE

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES