Question: 1. Draw a binary search tree which has the following values: 4, 6, 11, 22, 53, 94, 21, 53. You can place the nodes anywhere

 1. Draw a binary search tree which has the following values:

1. Draw a binary search tree which has the following values: 4, 6, 11, 22, 53, 94, 21, 53. You can place the nodes anywhere as you d like as long as it's a BSI Select one of the leaves of the BST you've drawn above. Next show how the contains algorithm from the TreesLecture.pdf, which we studied, goes through its execution on your BST to find the leaf node you've selected. Show the root node method call and subsequent recursive calls until you reach the value. Alongside your recursive call stacks, over the BST drawing, trace the path the contains method follows. (20 points) 2. Write an algorithm (in as close to Java code as possible) which has a runtime of (nlogn). Your algorithm must use a stack somehow. Explain what your algorithm does/its purpose/its parameters/what it returns. (20 points) 3. (n2). Write an algorithm (in as close to Java code as possible) which has a runtime of Your algorithm must use a queue and manipulate a String (somehow, it's completely up to you). Explain what your algorithm does/its purpose/its parameters/what it returns. (20 points) 1. Draw a binary search tree which has the following values: 4, 6, 11, 22, 53, 94, 21, 53. You can place the nodes anywhere as you d like as long as it's a BSI Select one of the leaves of the BST you've drawn above. Next show how the contains algorithm from the TreesLecture.pdf, which we studied, goes through its execution on your BST to find the leaf node you've selected. Show the root node method call and subsequent recursive calls until you reach the value. Alongside your recursive call stacks, over the BST drawing, trace the path the contains method follows. (20 points) 2. Write an algorithm (in as close to Java code as possible) which has a runtime of (nlogn). Your algorithm must use a stack somehow. Explain what your algorithm does/its purpose/its parameters/what it returns. (20 points) 3. (n2). Write an algorithm (in as close to Java code as possible) which has a runtime of Your algorithm must use a queue and manipulate a String (somehow, it's completely up to you). Explain what your algorithm does/its purpose/its parameters/what it returns. (20 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!