Data Structures.

Slides:



Advertisements
Similar presentations
40S Applied Math Mr. Knight – Killarney School Slide 1 Unit: Sequences Lesson: SEQ-L3 Drawing Fractal Patterns Drawing Fractal Patterns Learning Outcome.
Advertisements

More About Recursion - 2 Java. Looking at more recursion in Java A simple math example Fractals.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 19 Recursion.
Homework discussion Read pages 388 – 391 Page 400: 49 – 52, 72.
1 Merge Sort Merge Sort Reading p A Sorting Pattern The most efficient sorting algorithms all seem to follow a divide-and-conquer strategy.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved L10 (Chapter 19) Recursion.
Linear Fractal Mountains 2 step recursive process: –Subdivide chain by creating edge midpoints –Randomly perturb midpoint positions Gen 0: Gen 1: Gen 2:
The Wonderful World of Fractals
RECURSIVE PATTERNS WRITE A START VALUE… THEN WRITE THE PATTERN USING THE WORDS NOW AND NEXT: NEXT = NOW _________.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 20 Recursion.
1 Excursions in Modern Mathematics Sixth Edition Peter Tannenbaum.
An Introduction to Fractals By: Brian Feuer What is a Fractal? A word coined by Benoit Mandelbrot in 1975 to describe shapes that are “self-similar”
Triangle Town Hi, I’m Elke. Pleased to be your guide through Triangle Town. Don’t ever worry about getting lost. I’ll stay with you the whole time.
What is a Tessellation? A tessellation is a pattern of repeating figures that fit together with NO overlapping or empty spaces. Tessellations are formed.
Chapter 15 Recursion.
Python Programming in Context Chapter 9. Objectives To introduce functional programming style To practice writing recursive functions To introduce grammars.
Chapter 14 Recursion. Chapter Objectives Learn about recursive definitions Explore the base case and the general case of a recursive definition Learn.
Reading – Chapter 10. Recursion The process of solving a problem by reducing it to smaller versions of itself Example: Sierpinski’s TriangleSierpinski’s.
Recursive functions ACSL. A definition that defines an object in terms of itself is said to be recursive Many expressions may be defined recursively in.
Fractals Douglas reeves.
Fractals. Most people don’t think of mathematics as beautiful but when you show them pictures of fractals…
Fractals What do we mean by dimension? Consider what happens when you divide a line segment in two on a figure. How many smaller versions do you get? Consider.
1Computer Graphics Programming with OpenGL Three Dimensions – 2 Lecture 7 John Shearer Culture Lab – space 2
Computer Graphics I, Fall 2010 Programming with OpenGL Part 3: Three Dimensions.
CS 480/680 Computer Graphics Programming with Open GL Part 6: Three Dimensions Dr. Frederick C Harris, Jr. Fall 2011.
CS324e - Elements of Graphics and Visualization Fractals and 3D Landscapes.
Square Limit by M.C. Escher How are the fish in the middle of the design and the surrounding fish alike? How are they different?
Tessellation Project.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Chapter 15 Recursion.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Programming with OpenGL Part 3: Three Dimensions Ed Angel Professor of Computer Science,
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Programming with OpenGL Part 6: Three Dimensions Ed Angel Professor.
Fractals What are fractals? Who is Benoit Mandlebrot? How can you recognize a fractal pattern? Who is Waclaw Sierpinski?
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
A Primer on Chaos and Fractals Bruce Kessler Western Kentucky University as a prelude to Arcadia at Lipscomb University.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Chapter 18 Recursion CS1: Java Programming Colorado State University
Translations, Rotations, Reflections, and Dilations
12-1A Fractals What are fractals? Who is Benoit Mandlebrot?
Iterative Mathematics
Chapter 19 Recursion.
CS 1321.
Lines Associated with Triangles 4-3D
Programming with OpenGL Part 3: Three Dimensions
Four Numbers Game.
How is the Mandala an important part of Ancient India History?
S.K.H. Bishop Mok Sau Tseng Secondary School
The Wonderful World of Fractals
Programming with OpenGL Part 3: Three Dimensions
Growing Lines.
Here are four triangles. What do all of these triangles have in common
Recursion Definition: A method that calls itself. Examples
1 1/8” 1 1/8” 1 1/8” 3/8 boarder 1 1/8” 1 1/8” 1 1/8”
Tessellation Project.
Tessellation Project.
Day 84 – Enlargement.
Mid – Module Assessment Review
Programming with OpenGL Part 6: Three Dimensions
Programming with OpenGL Part 3: Three Dimensions
Fractals What do we mean by dimension? Consider what happens when you divide a line segment in two on a figure. How many smaller versions do you get?
5.4 Midsegment Theorem.
Computational Thinking
BIO BOX 10 Points Skills Required: fold Instructions:
Building instructions for pin wheel
An exercise on recursion
BIO BOX 10 Points Skills Required: fold Instructions:
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Programming with OpenGL Part 3: Three Dimensions
Angel: Interactive Computer Graphics5E © Addison-Wesley 2009
Surprising Connections in Math: From the Golden Ratio to Fractals
Presentation transcript:

Data Structures

Recursion Something is said to be recursive if each of the parts that make up the thing have a structure — in other words, a design or pattern — that repeats the structure of the whole thing itself. The fern shown here is recursive because each of its leaves has a structure like that of the entire fern itself.

Recursion The image shown here, a “Sierpinski gasket” is a recursive structure. It is generated by a recursive algorithm. A recursive algorithm is one that calls itself.

Here is an algorithm to draw a Sierpinski Gasket. Sierpinski (triangle) Start Find the mid point of each side of the triangle Draw lines connecting the midpoints, which will form four smaller triangles that can be called triangles A, B, C, and D, with D in the center and the others around it. Color in (or cut out) the center triangle Do Sierpinski (triangle A) Do Sierpinski (triangle B) Do Sierpinski (triangle C) Stop Here is an algorithm to draw a Sierpinski Gasket. It splits a triangle into four smaller triangles, and then calls itself for three of the four smaller triangles. It is a recursive algorithm.

They are among the most powerful and useful of all algorithms. Sierpinski (triangle) Start Find the mid point of each side of the triangle Draw lines connecting the midpoints, which will form four smaller triangles that can be called triangles A, B, C, and D, with D in the center and the others around it. Color in (or cut out) the center triangle Do Sierpinski (triangle A) Do Sierpinski (triangle B) Do Sierpinski (triangle C) Stop Recursive algorithms can generate complex structures from a simple instruction set. They are among the most powerful and useful of all algorithms.

Recursion Recursive algorithms can generate complex structures from a simple instruction set. They are among the most powerful and useful of all algorithms.