0% found this document useful (0 votes)
8 views17 pages

Algorithm Presentation Semester 1

An algorithm is a defined process or set of rules for problem-solving, particularly in computing. The document outlines the history, types, and representations of algorithms, as well as the steps for discovering, implementing, testing, and optimizing them. Key techniques mentioned include divide and conquer, dynamic programming, and greedy algorithms.

Uploaded by

92abdullahnoor
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)
8 views17 pages

Algorithm Presentation Semester 1

An algorithm is a defined process or set of rules for problem-solving, particularly in computing. The document outlines the history, types, and representations of algorithms, as well as the steps for discovering, implementing, testing, and optimizing them. Key techniques mentioned include divide and conquer, dynamic programming, and greedy algorithms.

Uploaded by

92abdullahnoor
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/ 17

ALGORITHM

• What is Algorithm?
• A process or set of rules to be
followed in calculations or
other problem-solving
operations, especially by a
computer.
ALGORITHM
HISTORY
• 1843:Adalovelace
• 1926:Term “Algorithm”
• 1950:Weather Prediction
• 1999:Google’s Algorithm
TYPES
• Brute Force Algorithm
• Recursive Algorithm
• Randomized Algorithm
• Sorting Algorithm
• Searching Algorithm
REPRESENTATION
NATURAL LANGUAGE
Algorithms can be described
in plain, everyday language
• Step 1: Start
• Step 2: Take input two numbers
• Step 3:Add the two numbers
• Step 4:Display two numbers
• Step 5:End
A structured, language-independent
way to write algorithms, focusing on
logic rather than syntax.

PSEUDOCODE
PROGRAMMMING CODE
The algorithm is directly implemented
in a programming language.
A graphical representation
using symbols like rectangles
(process), diamonds (decision points),
and arrows (flow direction).

FLOW CHART
DISCOVERY OF ALGORITHM
Understand Problem
• Clearly define the problem: What exactly needs to be solved?
• Input and Output: Identify what inputs are given and what
outputs are expected.
• Example: For sorting numbers, the input is an unsorted list, and
the output is the same list sorted in ascending or descending
order.
• Divide the problem into smaller tasks:
Each task should be simpler to handle.
• Example: For sorting, tasks can be
comparing two numbers, swapping them,
and repeating the process.

Break Down the Problem


Plan the Steps
• Think logically about the sequence
of operations.
• Use flowcharts, pseudocode, or simple
lists to organize your plan.
• Divide and Conquer
• Dynamic Programming
• Greedy Algorithms
• Brute Force
Choose the Right Technique
Implement the Algorithm
Write code based on your
planned steps in a programming
language of your choice.
• Run it with various test cases (including edge cases).
• Verify that the output is as expected.
• Example: For sorting, test with empty lists, single-element lists,
and large unsorted lists.

Test the Algorithm


Optimize the Algorithm
• Evaluate its efficiency:
Time Complexity: How long it takes to run (e.g., O(n), O(n²), O(log n)).
Space Complexity: How much memory it uses.
•Improve the algorithm by reducing unnecessary steps or using better techniques.

You might also like