12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

16Patterns of <strong>Algorithm</strong>sThis chapter presents several fundamental <strong>to</strong>pics related <strong>to</strong> the theory of algorithmsalgorithms. These include dynamic programming (Section 16.1), r<strong>and</strong>omized algorithms(Section 16.2), <strong>and</strong> the concept of a transform (Section 16.3.5). Each ofthese can be viewed as an example of an “algorithmic pattern” that is commonlyused for a wide variety of applications. In addition, we will discuss a numberof numerical algorithms in Section 16.3. Section 16.2 on r<strong>and</strong>omized algorithmspresents the Skip List (Section 16.2.2). The Skip List is a probabilistic data structurethat can be used <strong>to</strong> implement the dictionary ADT. The Skip List is comparablein complexity <strong>to</strong> the BST, yet often outperforms the BST, because the Skip List’sefficiency is not tied <strong>to</strong> the values of the dataset being s<strong>to</strong>red.16.1 Dynamic ProgrammingConsider again the recursive function for computing the nth Fibonacci number.int Fibr(int n) {if (n

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!