Class DS_SHELL_SORTER | ![]() ![]() |
indexing
description: "Indexable data structure sorters using shell sort algorithm" library: "Gobo Eiffel Structure Library" author: "Eric Bezault <ericb@gobosoft.com>" copyright: "Copyright (c) 1999, Eric Bezault and others" license: "Eiffel Forum Freeware License v1 (see forum.txt)"
class interface
DS_SHELL_SORTER [G -> COMPARABLE]
inherit
DS_INDEXABLE_SORTER [G] DS_SORTER [G]
feature -- Status report
sorted (a_container: DS_INDEXABLE [G]): BOOLEAN -- Is a_container sorted in increasing order? -- (From DS_SORTER.) require a_container_not_void: a_container /= Voidsubsorted (a_container: DS_INDEXABLE [G]; lower, upper: INTEGER): BOOLEAN -- Is a_container sorted in increasing order -- within bounds lower..upper? -- (From DS_INDEXABLE_SORTER.) require a_container_not_void: a_container /= Void valid_lower: 1 <= lower and lower <= a_container.count valid_upper: 1 <= upper and upper <= a_container.count valid_bounds: lower <= upper
feature -- Sort
sort (a_container: DS_INDEXABLE [G]) -- Sort a_container in increasing order. -- (From DS_SORTER.) require a_container_not_void: a_container /= Void ensure sorted: sorted (a_container)subsort (a_container: DS_INDEXABLE [G]; lower, upper: INTEGER) -- Sort a_container in increasing order -- within bounds lower..upper'? -- (From DS_INDEXABLE_SORTER.) require a_container_not_void: a_container /= Void valid_lower: 1 <= lower and lower <= a_container.count valid_upper: 1 <= upper and upper <= a_container.count valid_bounds: lower <= upper ensure subsorted: subsorted (a_container, lower, upper)
end -- class DS_SHELL_SORTER
Copyright © 1999, Eric
Bezault mailto:ericb@gobosoft.com http://www.gobosoft.com Last Updated: 25 September 1999 |
![]() ![]() ![]() ![]() |