Question: 5) Run Prim's algorithm on the weighted graph below, using vertex A as the source. What is the sum of the weights of the first,
5) Run Prim's algorithm on the weighted graph below, using vertex A as the source. What is the sum of the weights of the first, the third, and the fifth edges that are added to the output of Prim's algorithm? 11 13 (F 12 10 B) D 2 6) Draw the Binary Search Tree (BST) after inserting the following sequence of elements. Assume that smaller elements are on the left 6,4,8,1,12,3,19,5,20 7) Write a recursive method static int sizeofTreeNode root) that counts the number of nodes in a binary tree with the given root node. Do not use external fields to store intermediate results . For this question, assume you have a Node class that has the basic methods implemented:getLefio, getRight0, setLefto, setRight... 8) Draw the final result after inserting keys 5, 19, 28, 15, 20, 17, 10, 33 into a hash table with collisions resolved by (a) chaining, (b) linear probing. Let the table have eight slots with addresses starting at 0, and let the hash function be h(k)= k mod 8. 9) Implement a linear-time algorithm that given a binary search tree it transforms it into a reverse binary search tree
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
