Algorithms Paper 2 Flashcards

1
Q

What is an algorithm

A

A series 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

Example of non computer algorithm

A

Recipe

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

What is decomposition

A

Breaking a problem down into smaller simpler steps

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

What is an example of decomposition and why

A

Algorithms

Break a problem into a series of small steps

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

What is abstraction
General definition
Computer science definition

A

Removing detail

Focussing on the important information only and ignoring irrelevant detail

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

Example of abstraction

A

Abstract artwork

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

Why do we need abstraction

A

Removing detail makes things easier to understand ie a map

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

Example of abstraction in programming

A

Subroutine

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

Linear search definition

A

Simplest method of searching for data but it is slow / inefficient

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

Explain process of linear search

A

Starts at beginning of data set and looks at each piece of data in turn until the data is found (or reaches the end)

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

Advantages of linear search

A

Simple

Data set doesn’t need to be in order

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

Disadvantages of linear search

A

Inefficient and slow

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

Binary search definition

A

Breaking a data set in half (two pieces)

This divide and conquer method of searching is more efficient than linear search but only works if the data is sorted into order first

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

Which type of searching technique is faster

A

Binary search is faster

Linear search is slower

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

Advantages of binary search

A

More efficient / faster

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

Disadvantages of binary search

A

Requires data set to be in order / sorted