Index handler: Difference between revisions
Jump to navigation
Jump to search
m (Removed protection from "Index handler") |
No edit summary |
||
Line 1: | Line 1: | ||
== | == Representation invariant == | ||
At any time, an object of an implementation of this abstract data structure is repesented by a positive integral number <math>N</math> and a subset <math>I</math> of <math>\{1,\ldots,N\}</math>, the '''current indexes'''. | |||
== Method == | |||
''' | '''Name:''' reserve index | ||
'''Precondition:''' <math>|I|<N</math>. | |||
'''Return value:''' One of the indexes not in <math>I</math>. | |||
'''Postcondition:''' The returned index is inserted in <math>I</math>. | |||
== Method == | |||
'''Name:''' release index |
Revision as of 13:32, 20 October 2014
Representation invariant
At any time, an object of an implementation of this abstract data structure is repesented by a positive integral number [math]\displaystyle{ N }[/math] and a subset [math]\displaystyle{ I }[/math] of [math]\displaystyle{ \{1,\ldots,N\} }[/math], the current indexes.
Method
Name: reserve index
Precondition: [math]\displaystyle{ |I|\lt N }[/math].
Return value: One of the indexes not in [math]\displaystyle{ I }[/math].
Postcondition: The returned index is inserted in [math]\displaystyle{ I }[/math].
Method
Name: release index