array
holds many items of the same type
initializer list
the values that you instantiate in an array
index numbers
locations that are used to assign to each element found in the array
traverse
the way an element in a data structured is accessed, or modified
null
the default value for every object
NullPointerException
since null isn’t a valid object, the code performed on null will result in this
Sequential search
goes in order through each value until the desired one is found
Binary search
requires an ordered list of values, and every time it cuts the list of values in half until it finds the desired value
selection sort
the selection sort searches and swaps
merge sort
uses recursion, this type of sort divides and conquers, the array gets split into 2 pieces and then it is sorted, the 2 sorted pieces than come together to form one sorted list
recursion
using a method to call itself
insertion sort
the array is split into a sorted and unsorted part, the values from the unsorted part are placed at the correct position in the sorted part
2D Arrays
an array that holds items in a 2 dimensional grid, it’s storing items in rows and columns
Length property
Determines the number of elements in an array.
Length property is always one greater than the last Index.
True
Add() method
Appends one element to the end of an ArrayList, which gives it the highest index number.
How do you specify the location of an element with the add() function.
Listname(position, element);
Ie. myFriend(2,Kenny);
Clear() method
Removes all the elements in an array list
Remove(int index)
The element that needs to be remove needs to be specified.
Ie. myFriend(0): removes the first item and myFriend(4) removes the fifth item