Computer Science 1037A/B Lecture Notes - Lecture 44: Operator Overloading, Member Variable
Document Summary
A list that is maintained in sorted order relies upon the relational operators <= , == , etc. , being properly defined for the items in the list this may require operator overloading in the item class. Most ordered list operations will be the similar to those for the list adt (isfull, remove, retrieve, getlength, etc) No replace operation it could ruin list order. We"ll need a new insert function that stores an element in the proper place in the list so that ordering is maintained. We"ll also include a function find that returns the position of the first occurrence of a given item. We"ll use an array-based list member variable to store the list contents. Orderedlist construct an empty ordered list of objects isempty. Determine whether or not the list is empty getlength get the current size of the list remove. Remove value at a given position from the list retrieve.