Recursion: The Mirrors

11/10/98


Click here to start


Table of Contents

Recursion: The Mirrors

Introduction

Topics to be Covered

Recursive Solutions

Example 1: Factorial of N

Factorial of N : C++ solution

Factorial of N

Invariants

Example 2: Writing String Backwards

WriteBackward(S);

Variations of WriteBackward(S);

Computing Using Recursion

Power Function Using Recursion

Fibonacci Sequence

Counting Using Recursion

Searching Using Recursion

Implementation Considerations

C++ implementation

C++ implementation (Contd.)

Find the kth smallest element of an array

Find the Kth smallest… (Contd.)

Find the kth smallest.. algo

Recursion and Efficiency

Summary

Author: Kumar Madurai

Email: bina@cse.buffalo.edu

Home Page: http://www.cse.buffalo.edu/~bina