Write a program that can create an H-tree pattern, as illustrated below. Then develop a program that prints recursive patterns of your own design. The H-tree is another example of a fractal pattern like the Koch snowflake and Sierpinski triangle. It also of practical interest in circuit design. For example, imagine that we want to lay out circuit components on a microprocessor chip so that the length of wire connecting each component to the clock is the same. This property is desirable to achieve uniform wiring delay. The H-tree pattern is an elegant solution: position the clock in the center of the biggest H, and put each circuit component at one of the exposed endpoints of the smallest H's. Part 1. Though the H-tree pattern looks complex, it can be generated with a short recursive program. Your task is to write a program HTree.java with a recursive function htree and a main driver that calls the recursive function once, and animates the results using StdDraw. Think recursively: your function should draw an H and calls itself 4 times (with an appropriate stopping condition). Your program will read in a command line parameter N to control the depth of the recursion. First, make sure that your program can draw a single H, with N set to 1. Then, check that it draws five H's with N set to 2. Your program will be nearly (or completely) debugged when you get to this point. Below are the target H-tree patterns with N set to 1, 2, 3, 4, 5 and 6, respectively.   Part 2. In this part you will create your own recursive design. First, do something different for your basic graphic design. For example, you can have the regions represented by the recursive calls be rectangles of varying size, or you can have them overlap. Or, work with X's or S's instead of H's. Or, use StdDraw.spot to produce filled circles, filled squares, images, or text. Or, use five recursive calls and pentagons, or whatever. Try using color or introducing some randomness. Originality and creativity in the design will be a factor in your grade. Submission. Submit the files: HTree.java, Art.java, and readme.txt file. Your program Art.java should take a single command line parameter N that controls the depth of recursion. We will choose N between 1 and 7 to test it.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please help fast

Write a program that can create an H-tree pattern, as illustrated below. Then develop a program that prints recursive patterns of your own design.

The H-tree is another example of a fractal pattern like the Koch snowflake and Sierpinski triangle. It also of practical interest in circuit design. For example, imagine that we want to lay out circuit components on a microprocessor chip so that the length of wire connecting each component to the clock is the same. This property is desirable to achieve uniform wiring delay. The H-tree pattern is an elegant solution: position the clock in the center of the biggest H, and put each circuit component at one of the exposed endpoints of the smallest H's.

Part 1. Though the H-tree pattern looks complex, it can be generated with a short recursive program. Your task is to write a program HTree.java with a recursive function htree and a main driver that calls the recursive function once, and animates the results using StdDraw. Think recursively: your function should draw an H and calls itself 4 times (with an appropriate stopping condition).

Your program will read in a command line parameter N to control the depth of the recursion. First, make sure that your program can draw a single H, with N set to 1. Then, check that it draws five H's with N set to 2. Your program will be nearly (or completely) debugged when you get to this point. Below are the target H-tree patterns with N set to 1, 2, 3, 4, 5 and 6, respectively.

 

Part 2. In this part you will create your own recursive design. First, do something different for your basic graphic design. For example, you can have the regions represented by the recursive calls be rectangles of varying size, or you can have them overlap. Or, work with X's or S's instead of H's. Or, use StdDraw.spot to produce filled circles, filled squares, images, or text. Or, use five recursive calls and pentagons, or whatever. Try using color or introducing some randomness. Originality and creativity in the design will be a factor in your grade.

Submission. Submit the files: HTree.java, Art.java, and readme.txt file. Your program Art.java should take a single command line parameter N that controls the depth of recursion. We will choose N between 1 and 7 to test it.

HI HI
I
크
I
크
I
III
EI I
H
H H HI
되고
H
A HIS A T
IN AN
HHH H
HIHIHIHI
HH HI
HI HIFI
Transcribed Image Text:HI HI I 크 I 크 I III EI I H H H HI 되고 H A HIS A T IN AN HHH H HIHIHIHI HH HI HI HIFI
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education