Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-vvkck Total loading time: 0 Render date: 2024-04-27T21:27:00.046Z Has data issue: false hasContentIssue false

Chapter 17 - Advanced Algorithms

Published online by Cambridge University Press:  11 August 2009

Michael McMillan
Affiliation:
Pulaski Technical College, Arkansas
Get access

Summary

In this chapter we look at two advanced topics: dynamic programming and greedy algorithms. Dynamic programming is a technique that is often considered to be the reverse of recursion. Whereas a recursive solution starts at the top and breaks the problem down solving all small problems until the complete problem is solved; a dynamic programming solution starts at the bottom, solving small problems and combining them to form an overall solution to the big problem.

A greedy algorithm is an algorithm that looks for “good solutions” as it works toward the complete solution. These good solutions, called local optima, will hopefully lead to the correct final solution, called the global optimum. The term “greedy” comes from the fact that these algorithms take whatever solution looks best at the time. Often, greedy algorithms are used when it is almost impossible to find a complete solution, owing to time and/or space considerations, yet a suboptimal solution is acceptable.

A good source for more information on advanced algorithms and data structures is (Cormen, 2001).

DYNAMIC PROGRAMMING

Recursive solutions to problems are often elegant but inefficient. The VB.NET compiler, along with other language compilers, will not efficiently translate the recursive code to machine code, resulting in an inefficient, though elegant computer program.

Many programming problems that have recursive solutions can be rewritten using the techniques of dynamic programming. A dynamic programming solution builds a table, usually using an array, that holds the results of the different subsolutions.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2005

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Advanced Algorithms
  • Michael McMillan, Pulaski Technical College, Arkansas
  • Book: Data Structures and Algorithms Using Visual Basic.NET
  • Online publication: 11 August 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511547010.019
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Advanced Algorithms
  • Michael McMillan, Pulaski Technical College, Arkansas
  • Book: Data Structures and Algorithms Using Visual Basic.NET
  • Online publication: 11 August 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511547010.019
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Advanced Algorithms
  • Michael McMillan, Pulaski Technical College, Arkansas
  • Book: Data Structures and Algorithms Using Visual Basic.NET
  • Online publication: 11 August 2009
  • Chapter DOI: https://doi.org/10.1017/CBO9780511547010.019
Available formats
×