Running Time Examples (4)
{"Image DocumentName": "Running Time Examples (4)", "Image ImageDescription": "Example 5: O(nlogn) sum1 = 0; for (k=1; k<=n; k =2) O(logn) for (j=1; j<=n; j++) O(n) sum1++; sum2 = 0; for (k=1; k<=n; k =2) O(n) for (j=1; j<=k; j++) sum2++; First loop is \uf053n for k = 1 to log n, or \uf051(n log n). Second loop is \uf0532k for k = 0 to log n - 1, or \uf051(n). First loop is \uf053n for k = 1 to log n. Second loop is \uf0532k for k = 0 to log n.", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}