21

mmmmmmm

Embed Size (px)

Citation preview

Page 1: mmmmmmm
Page 2: mmmmmmm

Nabia Rahman Farjana Sarmin

MD. Osman Goni Sumayea Musarat

Name of Group

Members

Page 3: mmmmmmm

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.

Page 4: mmmmmmm

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!

Page 5: mmmmmmm

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.

Page 6: mmmmmmm

• Simple recursive algorithms

• Backtracking algorithms

• Divide and conquer algorithms

• Dynamic programming algorithms

• Greedy algorithms

• Branch and bound algorithms

• Brute force algorithms

• Randomized algorithms

Page 7: mmmmmmm

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

Page 8: mmmmmmm
Page 9: mmmmmmm

Given a list, find a specific element in the

list

We will see two types

Linear search

Binary search

Page 10: mmmmmmm
Page 11: mmmmmmm
Page 12: mmmmmmm

Given a list, put it into some order

We will see Three types

Bubble sort

Selection sort

Quick sort

Page 13: mmmmmmm
Page 14: mmmmmmm
Page 15: mmmmmmm
Page 16: mmmmmmm

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.

Page 17: mmmmmmm

It is a method for solving complex problems by breaking them down into simpler sub problems.

Page 18: mmmmmmm

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.

Page 19: mmmmmmm

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

Page 20: mmmmmmm

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

Page 21: mmmmmmm