0% found this document useful (0 votes)
6 views

Design and Analysis of Algorithms

Uploaded by

mikabinarytrade1
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)
6 views

Design and Analysis of Algorithms

Uploaded by

mikabinarytrade1
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

DESIGN AND ANALYSIS

OF ALGORITHMS
ALGORITHMIC TECHNIQUES
ALGORITHMIC TECHNIQUES
• Divide and Conquer
• Brute Force
• Greedy Technique
• Dynamic Programming
• Decrease and Conquer
• Backtracking
• Branch and Bond
ALGORITHMIC TECHNIQUES
• Divide and Conquer
• The Divide and Conquer strategy involves dividing the problem into
sub-problem, recursively solving them, and then recombining them
for the final answer.
• E.g. Merge sort,Quick sort, Binary search ,Defective Chess Board
• Brute force Attack
• Solving the problem based on problem statement definition
• E.g selection sort,Bubble sort, sequential search, Pattern matching
ALGORITHMIC TECHNIQUES
• Dynamic Programming
• Solving a problem with overlapping subproblems
• Dynamic Programming is a bottom-up approach we solve all possible
small problems and then combine them to obtain solutions for bigger
problems.
• E.g. Warshall’s Algorithm, Floyd’s Algorithm,Travelling salesman
Problem,Knapsack Problem
ALGORITHMIC TECHNIQUES
• Greedy
• Greedy method is used to solve the optimization problem.
• An optimization problem is one in which we are given a set of input values,
which are required either to be maximized or minimized (known as objective),
i.e. some constraints or conditions.
• Greedy Algorithm always makes the choice (greedy criteria) looks best at the
moment, to optimize a given objective.
• The greedy algorithm doesn't always guarantee the optimal solution however
it generally produces a solution that is very close in value to the optimal.
• E.g Knapsack Problem,Job Sequencingwith deadline,Dijktra’s Algorithm,
Prim’s Algorithm and Kruskal Algorithm
ALGORITHMIC TECHNIQUES
• Branch and Bound
• Systematically searching for a solution in state space
• In Branch & Bound algorithm a given subproblem, which cannot be
bounded, has to be divided into at least two new restricted subproblems.
• Branch and Bound algorithm are methods for global optimization in non-
convex problems.
• Branch and Bound algorithms can be slow, however in the worst case they
require effort that grows exponentially with problem size, but in some cases
we are lucky, and the method coverage with much less effort.
• E.g Knapsack Problem, Travelling Salesman Problem, Assignment Problem
ALGORITHMIC TECHNIQUES
• Backtracking
• Backtracking Algorithm tries each possibility until they find the right
one.
• It is a depth-first search of the set of possible solution.
• During the search, if an alternative doesn't work, then backtrack to the
choice point, the place which presented different alternatives, and tries
the next alternative.
• N-Queens Problem, Hamiltonian Circuit, Knapsack Problem
Sorting Algorithms
• A Sorting Algorithm is used to rearrange a given array or list of
elements according to a comparison operator on the elements. The
comparison operator is used to decide the new order of elements in the
respective data structure.
• Quick sort
• Selection sort
• Bubble sort
Selection sort

• Selection sort is a simple and efficient sorting algorithm that works by


repeatedly selecting the smallest (or largest) element from the unsorted
portion of the list and moving it to the sorted portion of the list.
• The algorithm repeatedly selects the smallest (or largest) element from the
unsorted portion of the list and swaps it with the first element of the
unsorted portion.
• This process is repeated for the remaining unsorted portion of the list until
the entire list is sorted.
• During each duration we will select the smallest item from the unsorted
partition and move it to the sorted partition
Examples
• 1.
Bubble Sort
• Bubble Sort is the simplest sorting algorithm that works by repeatedly
swapping the adjacent elements if they are in the wrong order.
• This algorithm is not suitable for large data sets as its average and
worst-case time complexity is quite high.
Examples

You might also like