2.2.2c - writing and following algorithms Flashcards

1
Q

What is an algorithm?

A

A step-by-step procedure for solving a problem or task.

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

What is pseudocode?

A

An informal, human-readable description of an algorithm.

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

What is flowcharting?

A

A visual representation of an algorithm using symbols and arrows.

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

What is the purpose of a well-defined algorithm?

A

To ensure consistency and accuracy in solving problems.

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

What is the first step in writing an algorithm?

A

Understanding the problem and its requirements.

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

What is an algorithm’s complexity?

A

A measure of the algorithm’s efficiency in terms of time or space.

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

What is a sequence in an algorithm?

A

A series of steps executed in order.

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

What is a decision in an algorithm?

A

A step that leads to different actions based on conditions.

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

What is an iteration in an algorithm?

A

A loop that repeats steps until a condition is met.

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

What is the role of testing in algorithm design?

A

To ensure that the algorithm solves the problem correctly and efficiently.

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

What is a dry run?

A

Manually going through an algorithm step by step to check for correctness.

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

What is the purpose of debugging algorithms?

A

To find and fix errors that prevent the algorithm from working correctly.

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

What does an algorithm’s time complexity measure?

A

The number of steps an algorithm takes relative to the input size.

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

What does an algorithm’s space complexity measure?

A

The amount of memory used by the algorithm.

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

Why is following an algorithm important?

A

It ensures the problem is solved consistently and efficiently.

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

What is the difference between an algorithm and a program?

A

A program is an implementation of an algorithm.