Algorithms & Data Structures David Vernon Copyright ©2007 David Vernon (www.vernon.eu) Course Content Introduction to Complexity of Algorithms • – Performance of algorithms – Time and space tradeoff – Worst case and average case performance – The big O notation – Example calculations of complexity Complexity and Intractability • – NP Completeness and Approximation Algorithms Copyright ©2007 David Vernon (www.vernon.eu) Course Content Simple Searching Algorithms • – Linear Search – Binary Search Simple Sorting Algorithms • – Bubblesort – Quicksort Copyright ©2007 David Vernon (www.vernon.eu) Course Content Abstract Data Types (ADTs) • Lists, Stacks, and Queues • – ADT specification – Array implementation – Linked-list implementation Copyright ©2007 David Vernon (www.vernon.eu) Course Content Trees • – Binary Trees – Binary Search Trees – Traversals – Applications of Trees » Huffman Coding – Height-balanced Trees » AVL Trees » Red-Black Trees Copyright ©2007 David Vernon (www.vernon.eu) Introduction to Analysis of Algorithms & Complexity Theory Copyright ©2007 David Vernon (www.vernon.eu) Complexity Analysis of complexity of programs • – Time complexity – Space complexity – Big-Oh Notation Introduction to complexity theory • – P, NP, and NP-Complete classes of algorithm Copyright ©2007 David Vernon (www.vernon.eu) Complexity Suppose there is an assignment • statement x := x +1 in your program. We’d like to determine: • – The time a single execution would take – The number of times it is executed FFrreeqquueennccyy CCoouunntt Copyright ©2007 David Vernon (www.vernon.eu) Complexity Product of time and frequency is the • total time taken Frequency count will vary from data set • to data set Copyright ©2007 David Vernon (www.vernon.eu) Complexity Since the execution time will be very • machine dependent (and compiler dependent), we neglect it and concentrate on the frequency count Consider the following three examples: • Copyright ©2007 David Vernon (www.vernon.eu)
Description: