COMP 250 Lecture Notes - Lecture 4: Edge Case, Dynamic Array, Linked List

47 views8 pages

Document Summary

Typically, you can do whatever you want with arrays -- have gaps, stick anything anywhere, etc. But when you"re making a list with an array, put things in the front of the array. Last class, we talked about expanding the array when it gets bigger (when you fill it up and its full). But that was an error -- it actually increases by 50%. When you want to make a new arraylist, you must specify the type . You only interact with it when you call out shape", referring to the new array list. When you call this with no argument passed through it, it creates an array underneath of size 10 . If you know how big the array should be though, then do this: Let"s say we want an arraylist of shapes. We have an array underneath, but that"s not the whole thing.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents