GoConqr has a new look! Let us know what you think.

Flashcards

CSE 110 Lecture 20, 21 Notes

Branden Roper CSE 110 English 28 cards

Cards in this deck (28)

  1. 1an object to store a list of dataArray
  2. 2this type of data can be saved as an array (not allowed to store different type data)Any Type (Primitive/Object)
  3. 3declaration of an array myArray of integer typeint[] myArray;
  4. 4initialization of an array myArray of integer type, size of 10myArray = new int[10];
  5. 5used to assign values to an arrayFor Loop
  6. 6used only for arrayBrackets []
  7. 7goes inside [] when referring to a value inside an arrayArray Index Number
  8. 8starts at 0Array Index
  9. 9used to find the length of an array myArraymyArray.length
  10. 10standard version of an enhanced for loop using variables element of type double and valuesfor (double element : values)
  11. 11used to search for an element until it is found; once the element is found, the search should be stoppedLinear/Sequential Search
  12. 12not an array object but a utility class for a list of objects similar to Math classArrays
  13. 13used to print out all elements of an array myArrayArrays.toString(myArray)
  14. 14used to sort the elements of an array myArrayArrays.sort(myArray)
  15. 15used to make a copy of an array myArray with an integer length lengthArrays.copyOf(myArray, length)
  16. 16an array that has both used and unused elementsPartially Filled Array
  17. 17a gap in an array; should be avoidedHole
  18. 18keep this as least as possible to save timeUpdate of Array Size
  19. 19search method that only works for a sorted arrayBinary Search
  20. 20when utilizing the binary search technique, this must be compared to the target valueMiddle Element
  21. 21binary search technique (short response)If the middle element is lower, exclude the lower half. If the middle element is higher, exclude the higher half. Repeat this process until the target is found.
  22. 22an object to store a list of objects (not primitives); dynamic (can grow and shrink); common array operations are built-inArrayList
  23. 23function of ArrayList to add an element a at the endvoid add(Object a)
  24. 24function of ArrayList to insert an element a at the position posvoid add(int pos, Object a)
  25. 25function of ArrayList to get the element at the given position pos (example is of int type)int get(int pos)
  26. 26function of ArrayList to set an element a at the position posvoid set(int pos, Object a)
  27. 27function of ArrayList to return the current lengthint size()
  28. 28function of ArrayList to delete an element at the given position posvoid remove(int pos)

Information

Description
CSE 110 (Notes) Flashcards on CSE 110 Lecture 20, 21 Notes, created by Branden Roper on 13/11/2017.
Created by
Branden Roper
Views
1
Tags
java
Rating

More on Arrays

Feedback

What is it about?

What do you think of the new look?

How do you like it?