CSE 214- Midterm Exam Guide - Comprehensive Notes for the exam ( 15 pages long!)

525 views15 pages

Document Summary

Chapter 1 - formatting, order of complexity software development for a method: intro/summary, description of parameters, preconditions, postcondition or returns, exceptions thrown, special notes on usage. %f oating point number with 6 digits after decimal point. %6. 2f > means print a oating point number with 6 total spaces, two of which are after the decimal point. Operations: execution of a single programming statement. (c = a+b) counted as one operation. O(n) > largest term is a constant time. A loop that does a xed amount of operations n times requires. A for loop with 1 statement is (n+1) = o(n). an example is linear search. O(log n) > doubling input will make the time increase by no more than a xed number of new operations, by c more operations. for(x = 1; x<=n; x=x*2) > runs log base2 (n+1) = o(log n). Binary search uses o(log n) 2^40 takes 40 iterations.