What Is an Algorithm?
πAlgorithm: an effective method expressed as a finite list of well-defined instructions for solving a
problem.
πAn algorithm is the list of instructions and rules that a computer needs to do to complete a task.
πIn essence, algorithms are simply a series of instructions that are followed, step by step, to do something useful or solve a problem.
@Computer_science_course
πAlgorithm: an effective method expressed as a finite list of well-defined instructions for solving a
problem.
πAn algorithm is the list of instructions and rules that a computer needs to do to complete a task.
πIn essence, algorithms are simply a series of instructions that are followed, step by step, to do something useful or solve a problem.
@Computer_science_course
Design can be shown using algorithms.
An algorithm must possess the following properties:
πfiniteness: The algorithm must always terminate after a finite number of steps.
πdefiniteness: Each step must be precisely defined; the actions to be carried out must be rigorously and
unambiguously specified for each case.
πinput: An algorithm has zero or more inputs, taken from a specified set of objects.
πoutput: An algorithm has one or more outputs, which have a specified relation to the inputs.
πeffectiveness: All operations to be performed must be sufficiently basic that they can be done exactly
and in finite length.
@Computer_science_course
An algorithm must possess the following properties:
πfiniteness: The algorithm must always terminate after a finite number of steps.
πdefiniteness: Each step must be precisely defined; the actions to be carried out must be rigorously and
unambiguously specified for each case.
πinput: An algorithm has zero or more inputs, taken from a specified set of objects.
πoutput: An algorithm has one or more outputs, which have a specified relation to the inputs.
πeffectiveness: All operations to be performed must be sufficiently basic that they can be done exactly
and in finite length.
@Computer_science_course
An algorithm may be expressed in a number of ways, including:
πNatural language:
πPseudocode
πFlow charts:
@Computer_science_course
πNatural language:
πPseudocode
πFlow charts:
@Computer_science_course
1. Flowchart
πIs a picture (graphical representation) of the problem
and solving process.
πA flowchart gives a step-by-step procedure for solution of a problem
@Computer_science_course
πIs a picture (graphical representation) of the problem
and solving process.
πA flowchart gives a step-by-step procedure for solution of a problem
@Computer_science_course
Example 3: πAn algorithm that list the multiplication table for a given number.
@Computer_science_course
@Computer_science_course
2. Pseudo-code
πfake and Informal language that helps programmers to plan an algorithm.
πIt is somewhat similar to everyday English with a feel of programming language.
@Computer_science_course
πfake and Informal language that helps programmers to plan an algorithm.
πIt is somewhat similar to everyday English with a feel of programming language.
@Computer_science_course
Example: π a Pseudo-code for a program that calculates the factorial for a given number.
@Computer_science_course
@Computer_science_course
Forwarded from C++ Programming
What is C++?
π C++ is a cross-platform language that can be used to create high-performance applications.
π C++ was developed by Bjarne Stroustrup, as an extension to the C language.
π C++ gives programmers a high level of control over system resources and memory.
@c_programming_tut
π C++ is a cross-platform language that can be used to create high-performance applications.
π C++ was developed by Bjarne Stroustrup, as an extension to the C language.
π C++ gives programmers a high level of control over system resources and memory.
@c_programming_tut