CSCA48H3 Lecture Notes - Lecture 4: Init, Operand, Alien 3

112 views7 pages
13 Feb 2016
School
Course

Document Summary

Csc a48 intro to computer science ii. Recursion means defining something in terms of itself usually at some smaller scale, perhaps multiple times, to achieve your objective. Programming languages generally support recursion, which means that, in order to solve a problem, functions can call themselves to solve smaller subproblems: drawing fractals. For our purposes, a fractal is a drawing which also has self-similar structure, where it can be defined in terms of itself. Let us start by looking at the famous koch fractal. An order 0 koch fractal is simply a straight line of a given size. An order 1 koch fractal is obtained like this: instead of drawing just one line, draw instead four smaller segments, in the pattern shown here: Repeating our pattern again gets us an order 3 koch fractal: To draw a koch fractal of order 3, we can simply draw four order 2 koch fractals.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers