Time efficiency of nonrecursive algorithms - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Time efficiency of nonrecursive algorithms

Description:

Steps in mathematical analysis of nonrecursive algorithms: ... Determine worst, average, and ... Simplify summation using standard formulas (see Appendix A) ... – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 13
Provided by: Alek170
Category:

less

Transcript and Presenter's Notes

Title: Time efficiency of nonrecursive algorithms


1
Time efficiency of nonrecursive algorithms
  • Steps in mathematical analysis of nonrecursive
    algorithms
  • Decide on parameter n indicating input size
  • Identify algorithms basic operation
  • Determine worst, average, and best case for input
    of size n
  • Set up summation for C(n) reflecting algorithms
    loop structure
  • Simplify summation using standard formulas (see
    Appendix A)

2
Max element
  • Input size ??
  • Basic operation ??
  • C(n) ??
  • Worst, average, best case ??

3
Max element
  • Input size n
  • Basic operation comparison
  • C(n) n-1 T(n)
  • Worst, average, best case .... all are the same

4
Unique elements
t
5
Unique elements
t
6
Matrix multipliacation
7
Matrix multipliacation
Note The number of multiplications, M(n) is
8
Matrix multipliacation
Note The running time of the algorithm on a
particular machine is
9
Selection sort
10
Selection sort
11
Insertion sort
12
Insertion sort
Write a Comment
User Comments (0)
About PowerShow.com