2.1 Flashcards

(26 cards)

1
Q

What is an algorithm?

A

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

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

True or False: An algorithm must be unambiguous.

A

True

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

Fill in the blank: An algorithm should produce a _____ for a given input.

A

output

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

Which of the following is NOT a property of algorithms? (a) Finiteness (b) Uniqueness (c) Complexity (d) Input

A

c) Complexity

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

What is the importance of algorithms in computer science?

A

They provide a clear set of instructions for solving problems and performing tasks efficiently.

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

What does ‘pseudocode’ refer to?

A

A simplified, half-code language used to design algorithms without the syntax of a specific programming language.

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

True or False: An algorithm can have multiple valid outputs for the same input.

A

False

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

What is a flowchart?

A

A visual representation of an algorithm using symbols to represent different types of actions or steps.

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

What is the term for a sequence of steps that leads to a solution?

A

Algorithm

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

In algorithms, what does ‘finiteness’ mean?

A

The algorithm must terminate after a finite number of steps.

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

Which symbol is typically used to represent the start and end of a flowchart?

A

Oval

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

What does ‘input’ refer to in the context of algorithms?

A

The data that is fed into the algorithm for processing.

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

What is a ‘conditional statement’ in an algorithm?

A

A statement that executes different actions based on whether a condition is true or false.

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

Fill in the blank: An algorithm should be _____, meaning it can be understood by humans.

A

clear

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

What is ‘complexity’ in relation to algorithms?

A

A measure of the resources required for an algorithm, usually in terms of time and space.

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

True or False: All algorithms can be implemented in any programming language.

17
Q

What does ‘iteration’ mean in algorithms?

A

A process of repeating a set of instructions until a certain condition is met.

18
Q

What is the purpose of ‘testing’ an algorithm?

A

To ensure that it works correctly and efficiently for all possible inputs.

19
Q

Which of the following is an example of an algorithm? (a) A recipe (b) A novel (c) A painting

20
Q

What do we call an algorithm that is designed to solve a specific problem?

A

Specialized algorithm

21
Q

What is ‘recursion’ in algorithms?

A

A method where the solution to a problem depends on solutions to smaller instances of the same problem.

22
Q

What does ‘output’ refer to in the context of algorithms?

A

The result produced by the algorithm after processing the input.

23
Q

Fill in the blank: An algorithm should be _____, meaning it can handle unexpected inputs gracefully.

24
Q

What is a ‘linear search’?

A

An algorithm that checks each element in a list one by one until it finds the target value.

25
Which term describes the efficiency of an algorithm in terms of its execution time?
Time complexity
26
True or False: A bubble sort is an example of a sorting algorithm.
True