Unit 6 - Algorithms Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is an algorithm?

A

An algorithm is a sequence of steps that can be followed to complete a task.

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

What is abstraction?

A

Removing unnecessary detail from a problem so that you can focus on the essentials.

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

What is decomposition?

A

Involves breaking down a large problem into smaller sub-problems.

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

What is binary search?

A

Involves ‘Divide and Conquer’
The list is halved and halved until what you want is found.
It has to be sorted before carrying out the search.

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

What is linear search?

A

Examining the list one by one.
You can do this if the list is unsorted. If it is, you can do a binary search.
This method is not that efficient.

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

What is bubble sort?

A

Each item is compared to the one next to it on the list. If it is bigger, it swaps places.
At the end of one pass, the largest item would be on the list.
This is repeated until the items are sorted

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

What are the two algorithms that you need to search a list?

A

Binary and Linear search.

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

What is insertion sort?

A

This algorithm sorts one data at a time.
One item is taken from the list and put in the correct position
This is repeated until the list is not unsorted.

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

What is merge sort?

A

This is much more efficient than bubble sort.
Divide the unsorted list into sub lists, each containing 1 item
Repeatedly merge two sub lists at a time to produce new sub lists until there is only one left.
This would be the sorted sub-list

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

Put in order the fastest to slowest of sorting algorithms:

A

Merge Sort
Insertion Sort
Bubble Sort

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

What is a variable?

A

A variable is a location in memory in which you can temporarily store text or numbers.

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

What are the three basic ways of controlling the flow of a program?

A

Sequence
Selection
Iteration

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