Classification of AlgorithmsKasun Ranga Wijeweera(Email: krw19870829@gmail.com)
Background• N = Primary Parameter• N might be The degree of a polynomial The size of a file to be sorted or searched Th...
1 CONSTANT• Most instructions of most programs are executed once or atmost only a few times• If all the instructions of a...
Log N LOGARITHMIC• This running time commonly occurs in programs that solve abig problem by transforming it into a smalle...
N LINEAR• It is generally the case that a small amount of processing isdone on each input element
N Log N LINE ARITHMIC• This running time arises for problems that solve a problem bybreaking it up into smaller sub probl...
N2 QUADRATIC• These problems arise in algorithms that process all pairs ofdata item• Example: Perhaps in a double nested ...
N3 CUBIC• These problems arise in algorithms that process triples of dataitems• Example: Perhaps in a triple nested loop
2N EXPONENTIAL• These problems arise naturally as “brute force” solutions toproblems
Reference
Any Questions?
Thank You!
Upcoming SlideShare
Loading in …5
×

Classification of Algorithms

386 views
272 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
386
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
11
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Classification of Algorithms

  1. 1. Classification of AlgorithmsKasun Ranga Wijeweera(Email: krw19870829@gmail.com)
  2. 2. Background• N = Primary Parameter• N might be The degree of a polynomial The size of a file to be sorted or searched The number of nodes in a graph, etc
  3. 3. 1 CONSTANT• Most instructions of most programs are executed once or atmost only a few times• If all the instructions of a program have this property, we saythat its running time is constant
  4. 4. Log N LOGARITHMIC• This running time commonly occurs in programs that solve abig problem by transforming it into a smaller problem, cuttingthe size by some constant fraction
  5. 5. N LINEAR• It is generally the case that a small amount of processing isdone on each input element
  6. 6. N Log N LINE ARITHMIC• This running time arises for problems that solve a problem bybreaking it up into smaller sub problems, solving themindependently, and then combining the solutions
  7. 7. N2 QUADRATIC• These problems arise in algorithms that process all pairs ofdata item• Example: Perhaps in a double nested loop
  8. 8. N3 CUBIC• These problems arise in algorithms that process triples of dataitems• Example: Perhaps in a triple nested loop
  9. 9. 2N EXPONENTIAL• These problems arise naturally as “brute force” solutions toproblems
  10. 10. Reference
  11. 11. Any Questions?
  12. 12. Thank You!

×