Algorithm CSC 111
Algorithm CSC 111
What is Algorithm?
An algorithm is a set of defined steps designed to perform a specific objective. This can
be a simple process, such as a recipe to bake a cake, or a complex series of operations
used in machine learning to analyze large datasets and make predictions. In the context
of machine learning, algorithms are vital as they facilitate the learning process for
machines, helping them to identify patterns and make decisions based on data.
Algorithms Explained
Algorithms are structured sets of instructions designed to solve specific problems or
perform particular tasks. They function through a series of well-defined steps, each
contributing to the ultimate goal. Here, we break down the typical stages involved in the
functioning of an algorithm:
1. Input. The first step involves defining the inputs that the algorithm will use.
Inputs are the data on which the algorithm will operate. It could be anything from
a single value to a complex data structure.
2. Processing. This is the core phase where the algorithm performs operations on
the inputs using a series of computational steps. This phase is guided by logical
and arithmetic calculations to process the data effectively. Within the processing
phase, there are often crucial substeps:
Looping. For many algorithms, certain steps need to be repeated multiple times
until a specific condition is met. Looping allows the algorithm to execute the
same steps repeatedly, optimizing the process and saving time.
Banking sector
Search engines
Types of Algorithms
We can categorize algorithms based on their use cases and their structural or problem-
solving strategies:
Graph algorithms: These deal with graphs, which are mathematical structures
used to represent pairwise relations between objects.
Greedy Algorithms: Greedy algorithms make locally optimal choices at each step
with the hope of finding the global optimum.
Divide and conquer algorithms: These algorithms divide the problem into smaller
subproblems, solve them independently, and then combine their solutions to
solve the original problem.
II. Efficiency
III. Simplicity
IV. Flexibility
V. Stability
VI. Security
VII.Maintainability