EiffelBase class
(HTML page generated by ISE Eiffel 4.2)
Eiffel Class
indexing
description: "Sequential lists where the cells are sorted in ascending order according to the relational operators of PART_COMPARABLE";
status: "See notice at end of class";
names: sorted_list, sorted_struct, sequence;
access: index, cursor, membership, min, max;
contents: generic;
date: "$Date: 2007-03-30 11:10:11 -0800 (Fri, 30 Mar 2007) $";
revision: "$Revision: 95354 $"
deferred class SORTED_LIST [G -> COMPARABLE]
inherit
PART_SORTED_LIST [G]
feature -- Measurement
min: like item is
-- Minimum item
require
not_empty: notempty
do
Result := first
ensure
min_is_first: Result = first
end;
max: like item is
-- Maximum item
require
not_empty: notempty
do
Result := last
ensure
max_is_last: Result = last
end;
median: like item is
-- Median item
require
not_empty: notempty
do
Result := i_th ((count + 1) // 2)
ensure
median_definition: Result = i_th ((count + 1) // 2)
end;
end -- class SORTED_LIST
|