Answer 1:
Pass 1:
0 inf inf inf inf inf
Pass 2:
0 7 9 inf inf 14
Pass 3:
0 7 9 22 inf 14
Pass 3:
0 7 9 20 inf 11
So B is the correct answer
Answer 2:
A is the correct answer
since for enqueuer, we insert at 2nd position and update
n as 2nd node
for dequeuer, we simply remove the 2nd node. So both
taking O(1) time.
Answer 3:
A is the correct answer again.
(If you need reasons please ping me through comments below.)
Answer 5:
A is correct since Starting from node B, it first
visits immediate neighbours A, E, and C. After visiting this path,
it visits F and D
Answer 6:
B is the correct answer, since it contains no
cycles and Items with added in ascending order.
Answer 7:
C is the correct answer since after adding edge 1,
edge 2 cannot be added to the tree
Answer 8:
A is the correct answer since for all i Heap(i)
> Max(heap(i*2 +1), heap(i*2+2))
Here are the answers champ. By the way, we are only allowed to answer 4 questions, so please post less numbers questions from next time. If you are facing any problem with the answers, please feel free to comment below. I shall be glad to answer you.
Can anybody help me with these questions? Plz... 1 pts Question 1 What would the cost...
Hi I'm stuck with this homework question and hope you can help me. 9. In the graph below (A) Determine the shortest path from a to ALL other nodes using Dijkstra's Shortest Path Algorithm. The answers must be in the following form: For each node, give the shortest path from a to that node (that is, list the nodes in the path) Also for each path give the length of the path. (B) ON THIS SHEET OF PAPER SHOWING A...
Question 4 Dijkstra's Routing Algorithm (15 points) 1) Use Dijkstra's algorithm to derive the routes from router D to the rest of the routers where associated link costs are listed in the following figure. 2 3 Dijkstra's algorithm for least cost path search steps source nodes destination nodes IA, B, C, E, F. G. H weights ID 2, 2, 1,,7,9- Question 4 Dijkstra's Routing Algorithm (15 points) 1) Use Dijkstra's algorithm to derive the routes from router D to the...
2. (a) (2 points - Completeness) Dijkstra's Walk-through Dijkstra's algorithm to compute the shortest paths from A to every other node in the given graph Show your steps in the table below. Do this by crossing out old values and writing in new ones as the algorithm proceeds 25 9 7 (D-G) 19 14 (B-E) 4 (A-C) 2 2 (G-H) Vertex Visited Cost Previous (b) (6 points-Correctness) All Vertices, in Order Visited: Visited-= Found the Shortest Path to) (c) (2...
5. If we apply binary dilation to the same large object twice using the same small structuring element, the effect, if any, of the second dilation on the object is that the object: (a) is unchanged (b) is completely removed (c) becomes larger (d) becomes smaller (e) does not change 6. Which of the following is/are true? (a) Dijkstra's algorithm can be used to find shortest paths in a network (b) Dijkstra's algorithm is a method to find straight lines...
9. Referring again to the problem of dynamic programming problem considered in Question 8, what is the cost of matching the two substrings ELEPHAN and EALEP? (a) 3 (b) 4 (c) 5 (d) 6 (e) None of the above 10. Which of the following statements is/are true? (i) Dijkstra's algorithm and the Fast Marching algorithm are identical (ii) Dijkstra's algorithm finds the shortest Euclidean path in space (ii) Dijkstra's algorithm finds the shortest path in a network (a) (i) only...
Discrete Mathematics with Applications by Susanna Epp, 4th Ed. Chapter 10.7, Exercise Question 14: Use Dijkstra's algorithm to find find the shortest path from a to z for each of the graphs in 14. In each case make tables similar to Table 10.7.1 to show the action of the algorithm. 14. b 1c1d 7 8 a 4 e 1 f 1 g 20 1 Table 10.7.1 V(T) E(T) Step F L(a) L(b) L(c) L(d) L(e) L(2) (a a) la) (b,...
Using java can someone help me create a program using the following instructions. Input file: 10 A J 18 A H 79 A I 81 J G 24 J F 76 G F 2 G H 50 F E 4 E D 2 D H 20 H C 50 I D 6 I C 97 I J 27 C B 22 Solution File: 142 A J G F E D H C B 4. (70 points) Implement Dijkstra's algorithm for...
Question 2 In the minimum grid-path problem we are given a two-dimensional grid, where each point on the grid has a value, which is a non-negative integer. We have to find a path from the top left corner of the grid to the bottom right corner, where each single step on the path must lead from one grid point to its neighbour to the right or below. The cost of the path is the sum of all values of the...
can you help me wirh this question please Question 7 1 pts 5- Draw the activity-on-node project network associated with the following activities for a construction project. How long should it take the team to complete this project? What are the critical path activities? Provide your answers in the blank fields below. Immediate Predecessor(s) Time (Days) Activity IA 3 B A 4 IC с A 6 D B 6 E B 4 IF c с 4 G D 6 H...
plz help me on this in java. QUESTION 28 Which modifiers can be applied to constructors? (Choose all that apply) A. absract B. final C. native D. strictfp E. static F. synchronized G.transient H. volatile I. None of these