classification of algorithms
TRANSCRIPT
![Page 2: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/2.jpg)
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
![Page 3: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/3.jpg)
1 CONSTANT• Most instructions of most programs are executed once or at
most only a few times• If all the instructions of a program have this property, we say
that its running time is constant
![Page 4: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/4.jpg)
Log N LOGARITHMIC• This running time commonly occurs in programs that solve a
big problem by transforming it into a smaller problem, cutting the size by some constant fraction
![Page 5: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/5.jpg)
N LINEAR• It is generally the case that a small amount of processing is
done on each input element
![Page 6: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/6.jpg)
N Log N LINE ARITHMIC• This running time arises for problems that solve a problem by
breaking it up into smaller sub problems, solving them independently, and then combining the solutions
![Page 7: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/7.jpg)
N2 QUADRATIC• These problems arise in algorithms that process all pairs of
data item• Example: Perhaps in a double nested loop
![Page 8: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/8.jpg)
N3 CUBIC• These problems arise in algorithms that process triples of data
items • Example: Perhaps in a triple nested loop
![Page 9: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/9.jpg)
2N EXPONENTIAL• These problems arise naturally as “brute force” solutions to
problems
![Page 10: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/10.jpg)
Reference
![Page 11: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/11.jpg)
Any Questions?
![Page 12: Classification of Algorithms](https://reader035.vdocuments.mx/reader035/viewer/2022081508/55649dcbd8b42a366c8b46f0/html5/thumbnails/12.jpg)
Thank You!