mmmmmmm
TRANSCRIPT
![Page 1: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/1.jpg)
![Page 2: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/2.jpg)
Nabia Rahman Farjana Sarmin
MD. Osman Goni Sumayea Musarat
Name of Group
Members
![Page 3: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/3.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/4.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/5.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/6.jpg)
• 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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/7.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/8.jpg)
![Page 9: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/9.jpg)
Given a list, find a specific element in the
list
We will see two types
Linear search
Binary search
![Page 10: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/10.jpg)
![Page 11: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/11.jpg)
![Page 12: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/12.jpg)
Given a list, put it into some order
We will see Three types
Bubble sort
Selection sort
Quick sort
![Page 13: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/13.jpg)
![Page 14: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/14.jpg)
![Page 15: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/15.jpg)
![Page 16: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/16.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/17.jpg)
It is a method for solving complex problems by breaking them down into simpler sub problems.
![Page 18: mmmmmmm](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/18.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/19.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/20.jpg)
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](https://reader031.vdocuments.us/reader031/viewer/2022020116/559e03e71a28ab156a8b47da/html5/thumbnails/21.jpg)