CSC 120 Lecture Notes - Lecture 20: Global Variable, Newline
CSC 120 verified notes
20/22View all
Document Summary
String array: using a for-loop to iterate over the sequence of valid indices, print the white space and the element at the index: Modifications to arrays requiring resizing: modifications that require resizing, array modifications involving resizing, e. g. , Insertion of an element: deletion of an element, appending elements from another array, merging multiple arrays into one, modification strategies, such modifications cannot be done without creating a new array. In the case of insertion, add the new element to the new array: finally, assign the new array to the variable pointing to the original (array is swapped with the new one) If a method takes upon such a task, it must return a new array. Insertion: deletion, array insertion and deletion program, create a string initial array whose size and elements are specified by the user, the elements may contain a whitespace, repetitively interact with the user to make modifications.