1) Fundamentals of Algorithms Flashcards

1
Q

What is abstraction?

A

Removing uncessary details so you can focus on the important parts

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

What are examples of abstraction?

A

Maps (focus on important details such as roads and landmarks)
Money

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

What is decomposition?

A

Breaking down a complex problem into smaller more manageable sub problems

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

What are advantages of decomposition?

A

Allows large teams to each solve a part of a problem

Allows seemingly impossible problems to be solved

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

What do structure charts visually represent?

A

Breaking down a large problem into smaller parts

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

What do the parts of structure charts respresent?

A

Each box- a smaller problem to be solved

Lines- which bigger problem the box is a part of

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

What is algorithmic thinking?

A

A way of solving problems by producing algorithms

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

What is an algorithm?

A

A reusable set of instructions to solve a given problem

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

How are algorithms written in computing?

A

Pseudocode

Flow diagrams

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

What is pseudocode?

A

A way to write algorithms using code like statements

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

What is pseudocode intended to be?

A

Readable

Easy to understand

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

What is the purpose of pseudocode?

A

Planning algorithms focusing on the logic and steps rather than specific syntax

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

What do arrows represent in flow diagrams?

A

The flow of control

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

What do ovals represent in flow diagrams?

A

Start and end of a program

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

What do rectangles represent in flow diagrams?

A

A process

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

What do parallelograms represent in flow diagrams?

A

An input or ouput

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

What do diamonds represent in flow diagrams?

A

A decision

18
Q

What do you need to look out for to interpret algorithms?

A

Identifiers
Inputs and outputs
Output messages
Comments

19
Q

What are comments?

A

Descriptions of code

20
Q

What is the easiest way to identify an algorithm?

A

Comments

21
Q

What are identifiers?

A

Names of variables, constants, subroutines

22
Q

What are common mistakes of algorithms? (3)

A

Incorrect operators
Incorrect identifiers
Missing processes

23
Q

What are common missing processes?

A

Lines of code being forgotten can lead to issues such as infinite loops

24
Q

What are 2 methods of completing an algorithm?

A

Trace tables

Identifying the algorithm

25
Q

What does each column of a trace table represent?

A

Each variable

26
Q

What does completing an algorithm mean?

A

Stating the output of an algorithm

27
Q

What is a search algorithm?

A

A set of instructions for finding a specific item of data within a data set

28
Q

What is an effective search?

A

A search which will always find the solution or determine if the target is not present

29
Q

What is an efficient search?

A

A search that will find the solution quickly regardless of its location within the data set

30
Q

What are 2 examples of search algorithms?

A

Linear search

Binary search

31
Q

What is a linear search?

A

Searching through a data set one piece of data at a time

32
Q

What are pros and cons of a linear search?

A

Pros- very easy to implement

Cons- slower on a long list

33
Q

What is an example of a divide-and-conquer search algorithm?

A

Binary search

34
Q

What is a binary search?

A

When you split a data set in two repeatedly until you find the target

35
Q

What are pros and cons of a binary search?

A

Pros- faster than a linear search on a large dataset

Cons- data must be sorted before searching

36
Q

What is a sort algorithm?

A

A set of instructions to arrange a dataset into a particular order

37
Q

What is an efficient sorting algorithm?

A

One which can sort a dataset in a short time

38
Q

What are 2 examples of sorting algorithms?

A

Bubble sort

Merge sort

39
Q

What is a bubble sort?

A

Comparing values in twos and swapping them if they are in the wrong order

40
Q

What are pros and cons of a bubble sort?

A

Pros- easy to implement, does not use much memory

Cons- poor for efficiency

41
Q

What is a merge sort?

A

Splitting lists ito lists of size one and merging each pair until there is only one list

42
Q

What are pros and cons of a merge sort?

A

Pros- very efficient algorithm

Cons- can be slower for small lists, needs additional memory