Arrays
data structure that makes it easier to handle similar types of data.
What arrays can store?
Primitive or object data types
Element
A seperate piece of data
index
is used to identify the specific location of this element.
Square brackets
are used to show that an array is present.
What do curly brackets indicate?
They indicate an initializer list
ArrayindexOutOfBoundsException
occurs when the indexes go out of bonds from what the array is actually set to.
enhanced for loop
it provides a variable that will hold each element of an array.
No variable
it is used to refer to the current index.
Sequential searches and Binary searches
It is called the 2 search algorithms
Sequential searches
These search through the data one by one in order, and take a long time to execute.
Binary searches
These search through the data for the desirable value by dividing it into half each time until the desired value is found.
Sorting Algorithms
They take data in an array, and rearrange it into a particular order.
Selection sort
This sort searches and swaps.
Insertion sort
It compares the first 2 elements, and depending on the outcome of this it inserts the second value in front of the first value into index 0, which moves the first value to index 1.
Merge Sort
This type of sort uses recursion.
Recursion
Technique that uses a method to call itself.