Mathematical Analysis of Non-Recursive Algorithm.

11,592 views 8 slides Apr 18, 2021
Slide 1
Slide 1 of 8
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8

About This Presentation

Mathematically analysis of non recursive algorithm with using some basic guide lines forward and back word substitution method


Slide Content

M a t h e m a t i c a l a n a l y s i s o f n o n - r e c u r s i v e a l g o r i t h m B h a r a t i . C M . T e c h

G e n e r a l p l a n D e c i d e t h e i n p u t s i z e . I d e n t i f y b a s i c o p e r a t i o n s . C h e c k h o w m a n y t i m e b a s i c o p e r a t i o n s i s e x e c u t e d & d e t e r m i n e b e s t , w o r s t , a v g c a s e a n a l y z e d s e p e r a t e l y . S e t u p s u m f o r b a s i c o p e r a t i o n . S i m p l i f y i n g t h e s u m u s i n g s t d f o r m u l a & r u l e s .

T h e i n p u t s i z e i s n . T h e b a s i c o p e r a t i o n i s c o m p a r i s o n i n l o o p f o r f i n d i n g l a r g e s t v a l u e . C o m p a r i s o n m a d e f o r e a c h v a l u e f o r n . C ( n ) b e t h e n o . o f . t i m e s c o m p a r i s o n i s e x e c u t e d . C ( n ) = o n e c o m p a r i s o n . S i m p l i f y t h e s u m . M a t h e m a t i c a l a n a l y s i s

M a t h e m a t i c a l a n a l y s i s T h e i n p u t s i z e o f t h e p r o b l e m i s n T h e b a s i c o p e r a t i o n i s i f A [ i ] = = A [ j ] T h e o u t t e r l o o p w i l l b e e x e c u t e d f i r s t t o l a s t b u t o n e e l e m e n t a n d i n n e r l o o p i s e x e c u t e d 2 t o n a r r a r y i n d e x . C ( n ) n o . o f . c o m p a r i s o n s t a t e m e n t i s e x e c u t e d i n w o r s t c a s e .
Tags