Week 3 - Algorithms Flashcards

1
Q

What can computer do with an array?

A

it can only look at the elements inside of it one at a time

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

What does Big O notation mean?

A

it describes the running time and it means “on the order of” something so we use it as an efficiency criterion to compare different logarithms. in other words, it means the “WORST Case” for the algorithm

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

The types of Big O notation are:

A

O (n^2)
O(n \log n)
O(n)
O(\log n)
O(1)

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

What does Ω mean?

A

Omega notation describes the lower bound of the number of steps for our algorithm, or how few steps it might take. in other words, it means the “BEST Case” for the algorithm

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

What does Θ mean?

A

it describes the running times of algorithms if the upper bound (Big O) and lower bound (Ω) are both the same.

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

What are the types of searching algorthims?

A

Linear Search
Binary Search

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

What does the Linear search algorithm do?

A

it goes through each element of a list until the desired element is found, and it will continuously repeat itself till the end of the data set. Known as the easiest searching algorithm.

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

What does the Binary search algorithm do?

A

it is used in a sorted array or list by starting in the middle and repeatedly dividing the problem in half each time till the end of the data set. Which is much faster than linear search.

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

What are the requirements of Binary search?

A

Data need to be sorted.
(and to sort data we need lots of memory)

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

What are the types of sorting algorthims?

A

Selection sort
Bubble sort
Merge sort

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

What does the Selection Sort algorithm do?

A

it sorts an array by repeatedly finding the smallest element from the unsorted part and putting it at the beginning (the sorted part)

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

What does the Bubble sort algorithm do?

A

it sorts an array by repeatedly comparing each pair (2) of elements and swapping the smallest element of them to the left

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