[go: up one dir, main page]

0% found this document useful (0 votes)
5 views13 pages

Introduction To Algorithms Lecture BeziaPrecious

Uploaded by

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

Introduction To Algorithms Lecture BeziaPrecious

Uploaded by

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

Introduction to Algorithms

Instructor: Bezia Precious


Contact: 652754416
What is an Algorithm?

An algorithm is a step-by-step set of instructions designed to solve a specific problem or


perform a task.
Importance of Algorithms

- Used in everyday problem solving.


- Essential for computer programming.
- Help break complex problems into simple steps.
- Improve efficiency and reduce errors.
Characteristics of a Good
Algorithm
- Clear and unambiguous steps.
- Finite number of steps.
- Well-defined inputs and outputs.
- Efficient in time and space.
Representing Algorithms

Algorithms can be represented in different ways:


1. Plain English
2. Flowcharts
3. Pseudocode
What is a Flowchart?

A flowchart is a diagram that shows the sequence of steps in a process using symbols and
arrows.
Basic Flowchart Symbols

- Oval: Start/End
- Rectangle: Process/Instruction
- Parallelogram: Input/Output
- Diamond: Decision
Flowchart Example: Find the
Largest of Two Numbers
Start → Input A, B → If A > B? → A is greater / B is greater → End
What is Pseudocode?

Pseudocode is a way of writing algorithms using plain language that resembles


programming syntax.
Pseudocode Example: Find the
Sum of Two Numbers
Start
Input A, B
Sum ← A + B
Output Sum
End
Benefits of Pseudocode

- Easy to write and understand.


- Helps in designing programs before coding.
- Language-independent.
Summary

- Algorithms are step-by-step instructions.


- Flowcharts and pseudocode help represent algorithms.
- They make problem-solving and coding easier and more efficient.
Revision Questions

1. Define an algorithm.
2. State three characteristics of a good algorithm.
3. List three methods of representing algorithms.
4. Draw a flowchart to find the sum of two numbers.
5. Write pseudocode to find the largest of two numbers.

You might also like