120 likes | 199 Views
269202 Algorithms for iSNE. Dr. Kenneth Cosh Week 1. Course Description.
E N D
269202 Algorithms for iSNE Dr. Kenneth Cosh Week 1
Course Description • Data Structures such as Sparse Matrix, B-tree, tries and graphs, Advanced sorting algorithms, Advanced searching algorithms, Information Processing Algorithms, Algorithms for Networking, Efficient implementation of algorithms.
This Week • Review • Introduction to Data Structures and Algorithms • Complexity Analysis
How do we find the most efficient algorithm? • To compare the efficiency of algorithms, computational complexity can be used. • Computational Complexity is a measure of how much effort is needed to apply an algorithm, or how much it costs. • An algorithm’s cost can be considered in different ways, but for our means Time and Space are critical. Time being the most significant.
Computational Complexity Considerations • Computational Complexity is both platform / system and language dependent; • An algorithm will run faster on my PC at home than the PC’s in the lab. • A precompiled program written in C++ is likely to be much faster than the same program written in Basic. • Therefore to compare algorithms all should be run on the same machine.
Computational Complexity Considerations II • When comparing algorithm efficiencies, real-time units such as nanoseconds need not be used. • Instead logical units representing the relationship between ‘n’ the size of a file, and ‘t’ the time taken to process the data should be used.
Time / Size relationships • Linear • If t=cn, then an increase in the size of data increases the execution time by the same factor • Logarithmic • If t=log2n then doubling the size ‘n’ increases ‘t’ by one time unit.
Asymptotic Complexity • Functions representing ‘n’ and ‘t’ are normally much more complex, but calculating such a function is only important when considering large bodies of data, large ‘n’. • Ergo, any terms which don’t significantly affect the outcome of the function can be eliminated, producing a function which approximates the functions efficiency. This is called Asymptotic Complexity.
Example I • Consider this example; • F(n) = n2 + 100n + log10n + 1000 • For small values of n, the final term is the most significant. • However as n grows, the first term becomes most significant. Hence for large ‘n’ it isn’t worth considering the final term – how about the penultimate term?
Remember? • Big O? • Big Ω? • Big Θ? • Simplify complexity equations!
Data Structures • So, throughout this course we will discuss some algorithms, and related data structures… What data structures have we talked about already?