Question: 4) Run Dijkstra's algorithm on the weighted graph below, using vertex A as the source. Write the vertices in the order which they are marked.
4) Run Dijkstra's algorithm on the weighted graph below, using vertex A as the source. Write the vertices in the order which they are marked. 10 12 E H 11 9 2 2 B D 3 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 3 13 F ( 2 12 10 9 () D 2 3 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:getLefto). getRight(), setLeft), setRight()... 8) Draw the final result after inserting keys 5. 19, 28, 19, 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
