Arrays Flashcards

1
Q

initialize arrays

A

type [] name = new int [size]
or
type [] name = {data 1, data 2, data 3, …}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Set value in arrays

A

name[index] = value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

set all values in arrays

A

for (int i = 0; i< name.length; i++) {
name[i] = values;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

sequential search in arrays

A

going through one by one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

binary search

A

splitting it in half and searching through it that way

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

selection sort

A

searches and swaps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

insertion sort

A

compares two at a time and swaps them depending on the rule

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

merge sort

A

uses recursion
split into two
each piece is sorted
merges them
continues the process till the whole thing is sorted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly