lec3 - Outline • Asymptotic Bound – Experimental...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Outline • Asymptotic Bound – Experimental results • Running Time, Definitions – Worst-time, average-time, expected-time • Running Time Analysis – Loop structures – Recursions (tree structures) 1 Experimental Results Running time Size n O(n) O(n log n) 10 50 100 1k 10k 0.01s 0.03s 100k 0.06s 0.15s 1M 0.74s 1.6s 10M 7.4s 16.5s Solvable size time O(n) 1s 1.4M 1m 81M 1d 117Bil x2 same x2 O(n2) O(2n) 2 weeks 2800 univ. N/A N/A N/A N/A N/A O(2n) 33 39 49 +1 0.27s 26.5s 44.2m 3.1d O(n log n) 720k 34M 35Bil x2− O(n2) 19k 150K 6M x1.4 2 Running Time, Definitions • Worst case – T (n) is the longest time of the algorithm running on any input of size n – Deterministic algorithm – Any possible input • Average case (lecture 4) – T (n) is the time of the algorithm running on a randomly generated input of size n – Deterministic algorithm – A random input • Expected case (in lecture 4) – T (n) is the expected time of the algorithm running on any input of size n – Randomized algorithm – Any possible input • (Best case) – Will not be considered, unless explicitly asked 3 Running Time Analysis, Guideline • Loop Structure – Number of nested loops – Number of iterations of each loop – Compute the related series • Recursive Relationship – Map to one of the known relationship – Unbalanced recursive relationship • Consider the running time from the overall picture 4 ...
View Full Document

Page1 / 4

lec3 - Outline • Asymptotic Bound – Experimental...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online