# lab03(1) - MIE335S Lab 03 Recursion Winter 2012 MIE335 Lab...

This preview shows pages 1–2. Sign up to view the full content.

MIE335S Lab 03 - Recursion Winter 2012 1 Introduction Fibonnaci and Towers of Hanoi are classical examples of recursion. 1.1 Deliverable Submit a MATLAB m-ﬁle that demonstrates the diﬀerences between fib1 and fib2 . The ﬁle should store and plot the time required as you look for the n th sequence position. Your ﬁle should be named (in low- ercase only) lab03 utorid.m . For example, if this is lab 1 and for UTORid of doejohn, name the ﬁle lab01 doejohn.m . Submit your ﬁle within 5 hours after the end of lab. function [f1 t1 f2 t2] = runFib(n) Where f1 is the n th Fibonacci number, and t1 the time it took to obtain the value using fib1 ; and f2 is the n th and t2 using fib2 . 2 Towers of Hanoi Take this example of the Towers of Hanoi. Towers of Hanoi is a mathematical puzzle. It has three rods, and a number of disks of diﬀerent sizes which can slide onto any rod. The puzzle begins with all the disks on one neat stack in order from smallest on top. The objective of the puzzle is to move the entire stack to another

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 03/31/2012 for the course MIE 335 taught by Professor Frances during the Spring '12 term at University of Toronto.

### Page1 / 2

lab03(1) - MIE335S Lab 03 Recursion Winter 2012 MIE335 Lab...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online