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

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

View Full Document Right Arrow Icon
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-file that demonstrates the differences between fib1 and fib2 . The file should store and plot the time required as you look for the n th sequence position. Your file should be named (in low- ercase only) lab03 utorid.m . For example, if this is lab 1 and for UTORid of doejohn, name the file lab01 doejohn.m . Submit your file 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 different 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
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
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 Right Arrow Icon
Ask a homework question - tutors are online