Java
Q1:
The diameter of a tree is defined to the largest of all shortest path distances in the tree. Give an efficient algorithm to compute the diameter of tree, given its root. Show that your algorithm is correct and analyze the running time of your algorithm.
Q2:
Given a list of university courses and their prerequisites, what is the minimum number of semesters needed to take all the courses? Assume that every course is offered every semester and you may take as many courses as you need to. Give an efficient algorithm for finding the minimum number of semesters, show that it is correct, and analyze the running time.
Q3:
Suppose that graph G is an undirected graph with an infinite number of vertices. Suppose that s and x are two distinct vertices in G, and that the distance between them is 2. Will BFS(s) always discover vertex x? Will DFS-Visit(s) always discover vertex x(assuming that DFS-Visit(s) is the first time DFS-Visit is called?) Justify your answers .If your answer is ’no’ to either question, are there conditions for which the answer would be ’yes?’ If so, state such conditions
5 years ago
20
- What is the significance of identifying your goals and interests when conducting a search for a particular position or career? Why is it important to identify the realities of specific professions that interest you? Consider and discuss how identifying go
- Critical Thinking Homework help
- can anyone help me with this assignment in less than three hours ?
- Homework
- Kim Wizard
- 2part assignment
- for Katetutor
- I need help and to make sure all points are followed on this project
- I need help with this paper
- Information Systems Project Management