Algorithmic Complexity Big O Notation Linear complexity Polynomial complexity

Algorithmic complexity big o notation linear

This preview shows page 13 - 26 out of 43 pages.

Algorithmic Complexity: Big “O” Notation Linear complexity Polynomial complexity Exponential complexity O(n) O(n k ) O(k n ) n: size of the input data 13
Image of page 13
Algorithmic Complexity: Examples Linear complexity : Processing input data beginning to end without going back e.g., smoothing each pixel in an image, encoding a document, translating, counting how many words total, etc. Polynomial complexity : Processing input data (or answer) back and forth e.g., removing duplicates in a document, tallying how many times each word appears in a document, shortest path in a graph, etc. Exponential complexity : Processing input data over and over to make cross-correspondences e.g., figuring out if two graphs have the same structure O(n) O(n k ) O(k n ) 14
Image of page 14
The Solution: Processing Data with a Divide-and- Conquer Strategy 15
Image of page 15
A Divide-and-Conquer Strategy Requires that each piece is independent of the others Divide into pieces Solve each piece separat ely Combine the individu al results 16
Image of page 16
Parallel Processing of a Dataset as Divide-and- Conquer Phase 1 Split the data Phase 2 Proces s the data Phase 3 Join the results 17
Image of page 17
Phase 1: Split Split Target = 5 It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair… It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair… 18
Image of page 18
Phase 2: Process in Parallel It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair… 19
Image of page 19
Phase 3: Join Join 20
Image of page 20
Phase 1: Split Split Target = 9 21
Image of page 21
Phase 2: Process in Parallel 22
Image of page 22
Phase 3: Join Join 23
Image of page 23
A Divide-and-Conquer Strategy Is Not Always Appropriate tps://commons.wikimedia.org/wiki/File:Giant_cell_glioblastoma_HE_X200.jpg 24
Image of page 24
Requirement that each piece is independent of the others 25 ps://en.wikipedia.org/wiki/Outline_of_chess ps://en.wikipedia.org/wiki/Travelling_salesman_problem#/media/File:Showing_a_step_of_the_two-opt_heuristic.png The steps within an algorithm may have significant interdependencies and require exchanging information, and may not be parallelizable
Image of page 25
Image of page 26

You've reached the end of your free preview.

Want to read all 43 pages?

  • Fall '17
  • Amdahl's law

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes