CS 2114 Chapter List Implementation Using Arrays: CS-2114 - Notes - Reading 8 - List Implementation Using Arrays

48 views3 pages

Document Summary

1 normally this class would be named arraylist, but since java already provides a class with that name, the textbook chose a different name to avoid confusion. Cs-2114 case (when newposition is 1 since it must shift all of the entries). resizing is required or not. The other tasks in the add method, including: example: making space for a new entry. Cs-2114: example: replacing public t replace(int givenposition, t newentry) { checkinitialization(); if ((givenposition >= 1) && (givenposition <= numofentries) { assert !isempty(); Sequential search: sequentially checks each element in a list until: example: adding to the end of a list. If the array of list entries is not satisfied; this technique is used in the contains method above. full, each step in this method is an (cid:4666)1(cid:4667) operation. Resizing an array is an (cid:4666)(cid:4667) operation, so the method ensurecapacity would be (cid:4666)(cid:4667).

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