) Which of the following does NOT describe a step in Dijkstra's algorithm? Select one: a. Start at the ending vertex and mark it with a 0 and label it as your current vertex by putting a circle around it. b. Once you've marked all of the vertices that are connected by an edge to your current vertex, label the current vertex as visited and put an X through it. c. Always replace a vertex's mark with the new calculated distance (even if it is larger than a previous mark). d. Identify all of the vertices that are connected by an edge to your current vertex, and calculate their distance to the ending vertex by adding their current mark to the weight of the connecting edge. 2)Time Complexity of DFS is? (V - number of vertices, E - number of edges) Select one: a. 0(V + E) b. 0(V*E) c. 0(V) d. 0(E) 3)If an optimal solution can be created for a problem by constructing optimal solutions for its subproblems, the problem possesses...........property. Select one: a. Optimal substructure b. Memoization c. Overlapping subproblems d. Greedy
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Answer these questions please
1) Which of the following does NOT describe a step in Dijkstra's
Select one: a. Start at the ending vertex and mark it with a 0 and label it as your current vertex by putting a circle around it. b. Once you've marked all of the vertices that are connected by an edge to your current vertex, label the current vertex as visited and put an X through it. c. Always replace a vertex's mark with the new calculated distance (even if it is larger than a previous mark). d. Identify all of the vertices that are connected by an edge to your current vertex, and calculate their distance to the ending vertex by adding their current mark to the weight of the connecting edge.
2)Time Complexity of DFS is? (V - number of vertices, E - number of edges)
Select one: a. 0(V + E) b. 0(V*E) c. 0(V) d. 0(E)
3)If an optimal solution can be created for a problem by constructing optimal solutions for its subproblems, the problem possesses...........property.
Select one: a. Optimal substructure b. Memoization c. Overlapping subproblems d. Greedy
Trending now
This is a popular solution!
Step by step
Solved in 2 steps