Algorithms Flashcards
What is an algorithm?
A sequence of logical instructions for carrying out a task.
What are two common methods for designing algorithms?
Pseudo-code and flowcharts.
What do algorithms focus on when being designed?
The logic of the steps.
What is meant by ‘language independent’ in the context of algorithms?
Programmers should be able to translate an algorithm into any programming language.
Fill in the blank: An algorithm can be designed using _______ and/or flowcharts.
pseudo-code
True or False: Algorithms are specific to a programming language.
False
What is the purpose of using statements and expressions in algorithms?
To provide clear instructions for solving a problem.
What is pseudo-code?
A method of writing up a set of instructions for a computer program using plain English.
What is a flowchart?
A diagram that shows the step-by-step flow of an algorithm.
What is a statement in an algorithm?
The smallest element of a programming language which expresses an action to be carried out.
What is a programming language?
A language used by a programmer to write a piece of software.
What is decomposition?
Breaking down a complex problem or system into smaller parts that are more manageable and easier to understand.
What is abstraction?
The process of extracting or withdrawing something eg. The underground Map
Psuedo-code can be broken into three sections. What are they?
Inputs
Processes
Outputs
What is assignment?
Setting the value of a variable in a computer program.
What is a variable?
A memory location within a computer program where values are stored.
What are data?
Units of information. In computing there can be different data types, including integers, characters and Boolean.
What symbols should be used for pseudo-code?
Line
It represents the flow from one component to the next.
An arrow.
What symbols should be used for pseudo-code?
Process
An action.
A rectangle.
What symbols should be used for pseudo-code?
Subroutine
Calls a subroutine,
A rectangle.
What symbols should be used for pseudo-code?
Input / Output
Calls an input or an output.
A squashed rectangle.
What symbols should be used for pseudo-code?
Decision
A yes/no/true/false decision.
A kite shape.
What symbols should be used for pseudo-code?
Terminator
The start or end of the process,
A rounded rectangle.
What is an input?
eg. in pseudo-code
myVar <– Input
Data which is inserted into a system for processing and/or storage as a variable.
What is an output?
Data which is sent out of a system and shown to the user.
How does a program communicate with the user?
The user must input
data into the system
This data must be processed
The outcome is output to the user
The data is stored for later use
What does a dry run mean?
Dry running an algorithm means to assign the values to variables of an algorithm and to do any processing that takes place without translating it into code.
What is a trace table?
Used when testing a program to record changes in variable values as code executes.
What is a standard algorithm?
A commonly agreed programming solution to a specific problem.
What does bubble sort mean?
A sorting algorithm that repeatedly passes through a list to be sorted, comparing and swapping items that are in the wrong order.
What does merge sort mean?
A sorting algorithm that repeatedly divides a list in half until each has only one item. The individual lists are then merged.
What does efficiency look at?
Efficiency looks at how much time it takes to run a particular algorithm and how much space is needed.
What is an array?
A set of data values of the same type, stored in a sequence in a computer program. Also known as a list.