This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Static Classes Big O Order of Complexity Linear Time Depends on/directly proportional to size (e.g. search in list O(n)) Constant Time Independent of input size (e.g. array[i], removing front from LinkedList O(1)) Quadratic Time Selection Sort (Worst Case O(n^2)) Insertion Sort (Worst Case O(n^2)) Best/Worse/Average Case Why Big O? Generalizes run-time regardless of computer specs Independent of hardware, programming language, control structure (for/while/recursion) Relevant when comparing things Time-space tradeoff More memory-> possible to redo algorithm to go faster (e.g. hashtable)...
View Full Document
This note was uploaded on 02/29/2012 for the course 198 112 taught by Professor Venugopal during the Spring '09 term at Rutgers.
- Spring '09