Binary Trees Binary Search Trees & Leetcode Practice Project
Question Description
Task 1
Assume you start with an empty 2-3-4 tree and the following numbers are added to the tree, in this order: 150, 70, 20, 9, 15, 60, 40, 42, 47, 45, 41, 46. REDRAW the tree after each number is inserted in it. Make sure you use the PROACTIVE approach for splitting the nodes as done in class (Tues, 10/6). See the slides on 2-3-4 trees for an example of how such a tree is built.
Grading criteria:- 5pts - correct insertion in leaf- 5pts - after each insertion the tree is a correct 2-3-4 tree- 5pts - nodes are split correctly- 5pts - the proactive aproach is used- 3pts - bonus from above for listing the names of the students that collaborated on that document.*** Note that if your insertions are wrong, you may not meet the specific cases that I tried to create during insertion and you may lose more points than just the points for the wrong insertions. You would also lose the points for the cases that you missed.
Task 2 Solve leetcode problems
- 226. Invert Binary Tree easy, build tree
- 100. Same Tree – easy, traversal, boolean
- 112. Path Sum – easy, boolean
- 108. Convert Sorted Array to Binary Search Tree – easy, build tree. YOU MUST IMPLEMENT A SPECIFIC solution by repeated insertion in the tree. The nodes will be created in the same order, but by repeatedly inserting the node in the tree. Note that in class (on Tuesday, 03/23) we solved it in another way. The code is posteed on the Daily page. For credit you need to submit a screen shot that shows ACCEPTED and the code that shows repeated insertion. You have to create a helper function named insert, and call that from the big function so that it is easy to read your code and see that it uses insertion. Sample image (note that this image shows the class solution. yours should show the required solution (including the insert function). ImageCodeAccepted
- 538. Convert BST to Greater Tree – build tree, medium
- 637. Average of Levels in Binary Tree – easy, the solution with level order traversal needs a queue. Use Java,C++ or any other language to use the queue implementation from their library. This problem is recommended so that you use one data structure (the queue) as part of the solution for the problem on trees. It gives an application for queues.
NOTE: I recommend this problem (637) but if you prefer, you replace it with another problem of your choice. The problem you choose to replace it, can be from any level (easy/medium/hard), but it must have the tag “Tree” or “Binary Search Tree”.
Just need screenshots of the completed leetcode problems.
"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."