0% found this document useful (0 votes)
28 views12 pages

Alghorithm

This document provides an overview of algorithms and algorithm design. It defines an algorithm as a set of step-by-step instructions to solve a problem or perform a task. Common algorithm design techniques are discussed, including divide and conquer, greedy algorithms, dynamic programming, and backtracking. Sorting algorithms are introduced as algorithms used to arrange data in a particular order. The document emphasizes that understanding algorithms is important as it allows students to break down problems into discrete steps to conceptualize solutions.
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)
28 views12 pages

Alghorithm

This document provides an overview of algorithms and algorithm design. It defines an algorithm as a set of step-by-step instructions to solve a problem or perform a task. Common algorithm design techniques are discussed, including divide and conquer, greedy algorithms, dynamic programming, and backtracking. Sorting algorithms are introduced as algorithms used to arrange data in a particular order. The document emphasizes that understanding algorithms is important as it allows students to break down problems into discrete steps to conceptualize solutions.
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/ 12

PRESENTED TO:

Mam Amrah Kamal


PRESENTED BY

 Kabsha Naseer  Muhammad Zain( C R )


 Hadia Noor  Tanveer Ahmad
 Tayyaba Fatima  Muhammad Muneeb
 Nadia Sunmbal  Muhammad Arshid
What is Algorithm:

An algorithm is
like a set of step-by-step instructions to solve a
problem or perform a task. It's like a recipe for
computer.
EXAMPLE:

Here's a simple example of an algorithm:


making a peanut butter and jelly sandwich.

1. Gather bread, peanut butter, and jelly.


2. Take two slices of bread.
3. Spread peanut butter on one slice.
4. Spread jelly on the other slice.
5. Press the two slices together.
6. Enjoy your delicious peanut butter and jelly sandwich!
Algorithm Design :

Algorithm design refers to the process of creating and


developing effective algorithms to solve specific
problems or perform tasks. It involves designing a step-
by-step plan or set of instructions that can be executed by
a computer or followed by a person. The goal is to create
an algorithm that is efficient, accurate, and meets the
requirements of the problem at hand. It's like creating a
roadmap to reach a desired destination.
Technique for Algorithm Design:
When it comes to algorithm design, there are
several common techniques that can be used. Some of these
techniques include.

1. Divide and conquer


2. Greedy algorithms
3. Dynamic programming
4. Backtracking
5. Sorting Algorithm
Divide and conquer:
Breaking down a problem into smaller sub problems, solving
them individually, and then combining the results.
Example:
Let's say you have an array of numbers that you want to
sort in ascending order. Here's how merge sort works using the
divide and conquer approach:
1. Divide: Split the array into two equal halves.
2. Conquer: Recursively sort each half by applying the merge sort
algorithm to them.
3. Combine: Merge the two sorted halves back together to obtain the
fully sorted array
Greedy Algorithm:
In this type of algorithm the solution is
built part by part. The solution of the next part is built based
on the immediate benefit of the next part. The one solution
giving the most benefit will be chosen as the solution for the
next part.
Dynamic Programming

This algorithm uses the concept of


using the already found solution to avoid repetitive
calculation of the same part of the problem. It divides the
problem into smaller overlapping sub problems and solves
them.
Backtracking Algorithm

The backtracking
algorithm basically builds the solution by searching
among all possible solutions. Using this algorithm,
we keep on building the solution following criteria.
Whenever a solution fails we trace back to the failure
point and build on the next solution and continue this
process till we find the solution or all possible
solutions are looked after.
Sorting Algorithm:
Sorting is arranging a group of
data in a particular manner according to the requirement. The
algorithms which help in performing this function are called
sorting algorithms. Generally sorting algorithms are used to
sort groups of data in an increasing or decreasing manner.
Why are Algorithms Important to Understand?

Algorithmic thinking, or the ability to


define clear steps to solve a problem, is crucial in many
different fields. Even if we’re not conscious of it, we use
algorithms and algorithmic thinking all the time. Algorithmic
thinking allows students to break down problems and
conceptualize solutions in terms of discrete steps. Being able
to understand and implement an algorithm requires students
to practice structured thinking and reasoning abilities.

You might also like