Case Study 2:
def sierpinski(myTurtle, p1, p2, p3, depth) :
if depth > 0:
sierpinski(myTurtle, p1,
midPoint(p1, p2) , midPoint(p1, p3) , depth - 1)
sierpinski(myTurtle, p2,
midPoint(p2, p3) , midPoint(p2, p1) , depth - 1)
sierpinski(myTurtle, p3,
midPoint(p3, p1) , midPoint(p3, p2) , depth - 1) else:
drawTriangle(myTurtle, p1, p2, p3)
-Refer to the session in the accompanying Case Study 2. Which parameter to the sierpinski function is reduced during the recursive step?
A) p1
B) p2
C) p3
D) depth
Correct Answer:
Verified
Q2: In a recursive function, the _ identifies
Q3: Case Study 1:
1. def drawSquare(aTurtle, side):
2. for
Q4: Case Study 1:
1. def drawSquare(aTurtle, side):
2. for
Q5: When drawing a tree with a recursive
Q6: How many recursive steps are used to
Q8: Case Study 2:
def sierpinski(myTurtle, p1, p2, p3,
Q9: How is the Sierpinski triangle drawn?
A) The
Q10: When drawing a Koch snowflake, what is
Q11: In computer science, a grammar consists of:
A)
Q12: In a grammar, the _ is the
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents