Topic 6 Flashcards

1
Q

What is abstraction?

A

Removing unnecessary details from a problem in order to solve it.

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

what is decomposition?

A

Breaking down a problem into smaller more manageable parts.

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

A linear search requires the data to be in which order?

A

Unsorted data

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

A binary search requires the data to be in which order?

A

Sorted data - i.e numerical or alphabetical

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

How does a linear search work?

A

Start at the beginning of a list and look at every item until you find the one you want.

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

How does a binary search work?

A

Repeatedly divide in half the portion of the data list that could contain the required data item. This is continued until there is only one item left in the list.

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

How does a bubble sort work?

A

Repeatedly going through the list to be sorted, comparing each pair of adjacent elements. If the elements are in the wrong order they are swapped.

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

How does an insertion sort work?

A

Sorts one data item at a time. Takes one data item from the list and places it in the correct position in the list. This is repeated until there is no more unsorted data items in the list.

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

How does a merge sort work?

A

Stage 1:
The list is successively divided in half, forming two sublist, until each sublist of length: one.
Stage 2:
Each pair of sublists is repeatedly merged to produce new sorted sublists until there is only one sublist remaining. This is the sorted list.

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

What are the 3 constructs used to write algorithms in pseudocode?

A

Sequence
Selection
Iteration

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

What is a sequence?

A

Writing the steps down in the order that they need to happen.

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

What is selection?

A

When the program will only run if the condition is met.

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

What is iteration?

A

a loop (while, for)

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