Computer Science 1037A/B Lecture Notes - Lecture 44: Operator Overloading, Member Variable

20 views1 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents