0% found this document useful (0 votes)
3 views

Algorithm CSC 111

Uploaded by

gideon.aleburu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Algorithm CSC 111

Uploaded by

gideon.aleburu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Algorithm

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:

 Decision making. At various points during processing, decisions need to be


made based on certain conditions. This substep involves directing the flow of the
algorithm based on conditional statements, leading to different paths in the
algorithm.

 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.

3. Output. After processing the inputs through various computational and


conditional steps, the algorithm produces an output. This output is the result of
the algorithm’s operations and is used to solve the problem or perform the task
at hand.

4. Termination. An algorithm must have a defined stopping point to ensure it


doesn’t run indefinitely. Once all the steps are executed successfully, and the
output is produced, the algorithm reaches its termination point.

What are Algorithms Used for?


 Navigation (GPS application)

 Banking sector

 Social media platform

 Search engines

Types of Algorithms
We can categorize algorithms based on their use cases and their structural or problem-
solving strategies:

Algorithm Use Cases

 Search algorithms: Designed to retrieve information stored within some data


structure

 Sorting algorithms: They rearrange the elements of a dataset in a specified order.

 Graph algorithms: These deal with graphs, which are mathematical structures
used to represent pairwise relations between objects.

Structural or Problem-solving Strategies

 Dynamic programming algorithms: Implemented to solve problems by breaking


them down into smaller subproblems

 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.

 Backtracking algorithms: They work by trying different solutions and


backtracking to find the correct solution when a dead end is reached.
What Makes a Good Algorithm?
I. Correctness

II. Efficiency

III. Simplicity

IV. Flexibility

V. Stability

VI. Security

VII.Maintainability

How to Create an Algorithm


Here are the detailed steps along with the tools and technologies that can be employed
to create a successful algorithm:

1. Identify the problem

2. Analyse the problem

3. Design the algorithm

4. Select appropriate tool and techniques

5. Implement the algorithm

6. Test the algorithm

7. Optimize the algorithm

8. Document the algorithm

9. Deploy the algorithm

10. Maintain and upgrade the algorithm

You might also like