CPSC 319 Lecture Notes - Lecture 5: Cengage Learning, Linked List, Geoffrey Chaucer

108 views6 pages

Document Summary

Each element of a list might consist of: a single data item, or, a record or object (compound data) A list is an abstract data type (adt) that supports these operations: add(newentry) Adds an item to the end of the list: insert(newentry, position) Inserts an item into a list at the specified position: delete(position) Deletes the item at the specified position: clear() Deletes all items from the list: getentry(position) Return the item at the specified position: may be done by value or by reference, replaceentry(position, newentry) Overwrite the item at the specified position with a new item: getlength() Returns the number of items currently in the list: isempty() Returns true if no items in the list, false otherwise: isfull() Returns true if the list is full, false otherwise: display() Prints out all items in the list: contains(itemkey) Returns true if the list contains the item, false otherwise: search(itemkey) Returns the item that matches the key (or nil if no match)

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