Upload
kawsar-ahmed
View
374
Download
1
Tags:
Embed Size (px)
Citation preview
Nabia Rahman Farjana Sarmin
MD. Osman Goni Sumayea Musarat
Name of Group
Members
An algorithm is a procedure or formula for solving a problem.
Derives from the mathematician, Mohammed ibn-Musa al-Khwarizmi.
Al-Khwarizmi's work is the likely source for the word algebra as well.
In mathematics and computer science, an algorithm is a step-by-step procedure for calculations.
Algorithms are used for calculation, data processing, and automated reasoning.
A program is one type of algorithm
All programs are algorithms
Not all algorithms are programs!
Using a similar problem-solving approach can be grouped together
The purpose is not to be able to classify an algorithm as one type or another, but to highlight the various ways in which a problem can be attacked.
• Simple recursive algorithms
• Backtracking algorithms
• Divide and conquer algorithms
• Dynamic programming algorithms
• Greedy algorithms
• Branch and bound algorithms
• Brute force algorithms
• Randomized algorithms
A simple recursive algorithm: Solves the base cases directly
Recurs with a simpler sub problem
Does some extra work to convert the solution to the simpler sub problem into a solution to the given problem
I call these “simple” because several of the other algorithm types are inherently recursive
Given a list, find a specific element in the
list
We will see two types
Linear search
Binary search
Given a list, put it into some order
We will see Three types
Bubble sort
Selection sort
Quick sort
In computer science, divide and conquer is an important algorithm design paradigm based on multi-branched recursion.
It works by recursively breaking down a problem into two or more sub-problems.
It is a method for solving complex problems by breaking them down into simpler sub problems.
It is a general algorithm for finding optimal solutions of various optimization problems.
A branch-and-bound algorithm consists of a systematic calculation of all candidate solutions.
A brute force algorithm simply tries allpossibilities until a satisfactory solution is found- Such an algorithm can be:Optimizing
- Example: Finding the best path for a travelling salesman
Satisfying- Example: Finding a travelling salesman path that is within 10% of optimal
A randomized algorithm uses a random number at least once during the computation to make a decision
Example: In Quicksort, using a random number to choose a pivot
Example: Trying to factor a large prime by choosing random numbers as possible divisors