1 / 2

Program Design using Recursion

Program Design using Recursion. Recursion is a very powerful design (and programming) technique Consider using recursion when Designing algorithm for problem of “size” N, AND If you’re giving a problem of size N – m, you can add-to or alter that solution to solve the problem of size N.

natala
Download Presentation

Program Design using Recursion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Program Design using Recursion • Recursion is a very powerful design (and programming) technique • Consider using recursion when • Designing algorithm for problem of “size” N, AND • If you’re giving a problem of size N – m, you can add-to or alter that solution to solve the problem of size N.

  2. Example Recursive Designs • Compute N ! (N factorial) • Determine if a string is a palindrome • Binary Search (of a sorted array) • Towers of Hanoi • Merge Sort • MANY data structure problems associated with trees, graphs, lists, …

More Related