Algorithms Flashcards
What is an algorithm?
Definition: An algorithm is a step-by-step procedure or set of instructions designed to solve a specific problem or accomplish a particular task.
What is an algorithm?
Example: Recipe for baking a cake, instructions for solving a math problem.
How can an algorithm be represented?
Representation: Algorithms can be represented using various methods, including written instructions, flowcharts, pseudocode, or programming languages.
How can an algorithm be represented?
Example: Writing a set of instructions for making a sandwich, drawing a flowchart for a simple game.
When are algorithms used?
Usage: Algorithms are used in various fields, including computer science, mathematics, cooking, and problem-solving.
When are algorithms used?
Example: Sorting algorithms in computer science, following a recipe in cooking
What is a flowchart?
Definition: A flowchart is a graphical representation of an algorithm or process, using different shapes and arrows to depict the flow of control.
What is a flowchart?
Example: Flowchart for a simple game, flowchart for a decision-making process.
Iteration
Repeating a set of instructions multiple times until a specific condition is met or for a certain number of times.
Sequence: Executing instructions or steps in a specific order, one after another, without any branching or repetition.
Selection
Making decisions based on certain conditions, where different paths or actions are taken depending on the outcome of those conditions.
Sequence
Executing instructions or steps in a specific order, one after another, without any branching or repetition.
Start/End Symbol:
Indicates the beginning or end of a flowchart. Usually represented by an oval shape.
Process Symbol:
Represents a step or action to be performed. Usually depicted by a rectangle.
Decision Symbol:
Represents a decision point where a condition is evaluated, and different paths are followed based on the outcome. Often depicted by a diamond shape.
Input/Output Symbol:
Represents input or output operations, such as reading data or displaying results. Typically shown as a parallelogram.