CMSC 131A Final: Final Exam (1/2) - Fall 2017

120 views26 pages

Document Summary

There are a wide variety of data structures that we can use or create to attempt to hold data in useful, organized, efficient ways. Similar to an arraylist, an array is a linear, contiguous, homogenous structure that can hold an arbitrary number of elements but is available in all languages. Elements in an array of size n are indexed (some languages do 1n, many like java use 0n-1) and that is the only way we can access items inside. The data structure has a first and last position. In an array with more than 1 element, any position other than the first has a previous position and any position other than the last has a next position. In java, an array is an object and we will have a variable serve as a reference to that object. We will indicate the type of elements that will be stored when we declare it. datatype[] arrayname;

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

Related Documents