2.1 Flashcards
What is an algorithm?
A step-by-step procedure or formula for solving a problem.
True or False: An algorithm must be unambiguous.
True
Fill in the blank: An algorithm should produce a _____ for a given input.
output
Which of the following is NOT a property of algorithms? (a) Finiteness (b) Uniqueness (c) Complexity (d) Input
c) Complexity
What is the importance of algorithms in computer science?
They provide a clear set of instructions for solving problems and performing tasks efficiently.
What does ‘pseudocode’ refer to?
A simplified, half-code language used to design algorithms without the syntax of a specific programming language.
True or False: An algorithm can have multiple valid outputs for the same input.
False
What is a flowchart?
A visual representation of an algorithm using symbols to represent different types of actions or steps.
What is the term for a sequence of steps that leads to a solution?
Algorithm
In algorithms, what does ‘finiteness’ mean?
The algorithm must terminate after a finite number of steps.
Which symbol is typically used to represent the start and end of a flowchart?
Oval
What does ‘input’ refer to in the context of algorithms?
The data that is fed into the algorithm for processing.
What is a ‘conditional statement’ in an algorithm?
A statement that executes different actions based on whether a condition is true or false.
Fill in the blank: An algorithm should be _____, meaning it can be understood by humans.
clear
What is ‘complexity’ in relation to algorithms?
A measure of the resources required for an algorithm, usually in terms of time and space.
True or False: All algorithms can be implemented in any programming language.
True
What does ‘iteration’ mean in algorithms?
A process of repeating a set of instructions until a certain condition is met.
What is the purpose of ‘testing’ an algorithm?
To ensure that it works correctly and efficiently for all possible inputs.
Which of the following is an example of an algorithm? (a) A recipe (b) A novel (c) A painting
a) A recipe
What do we call an algorithm that is designed to solve a specific problem?
Specialized algorithm
What is ‘recursion’ in algorithms?
A method where the solution to a problem depends on solutions to smaller instances of the same problem.
What does ‘output’ refer to in the context of algorithms?
The result produced by the algorithm after processing the input.
Fill in the blank: An algorithm should be _____, meaning it can handle unexpected inputs gracefully.
robust
What is a ‘linear search’?
An algorithm that checks each element in a list one by one until it finds the target value.
Which term describes the efficiency of an algorithm in terms of its execution time?
Time complexity
True or False: A bubble sort is an example of a sorting algorithm.
True