You are given a collection of directed, weighted edges that…

You are given a collection of directed, weighted edges that represent a graph. Each edge connects two nodes and has a weight associated with it. An edge is defined using the following class: public class Edge {    public E src;    public E dest;    public int weight;} Implement a method with the signature: public Queue fidnGreedyPath(List edgeList, E src, E dest) that does the following: Given src and dest nodes, return a Queue of Edges that represents a path from src to dest in which each edge is the lightest (lowest weight) edge coming out of each node in the path that does not result in a cycle, i.e. does not go back to a node that is already in the path. For instance, let’s say you have the following graph and have “A” as the src and “E” as the dest:     The method should work as follows: We start at the src, which is A. The lightest edge coming out of A is the one to C, which has a weight of 4, so we would add that Edge to the Queue; note that although there is an edge to our dest node, we don’t select that one since it’s not the lightest Now we’re at C. There is only one edge coming out of it, which goes to D, so we add that Edge to the Queue. Now we’re at D. The lightest edge is the one going to A, but we have already visited A, so we look for the next lightest edge, which is the one going to E, and we add that Edge to the Queue. We’re at E, which is the dest, so we’re done, we return the Queue containing the three Edge objects. You may assume that: the graph is completely connected, i.e. every node is reachable from every other node, which means that every node has at least one Edge. edge weights are always positive all edges coming out of a node have distinct weights, i.e. there will never be a tie for the lightest edge you do not need to check for null inputs values or any other error conditions in your implementation Last, you may also assume that a solution always exists for every src-dest pair in the graph; you do not need to worry about the case when all of a node’s outgoing edges go to nodes that are already in the path. This question will be graded by a member of the instruction staff; partial credit is possible. It is okay if there are slight compilation errors in your code, but you will lose points for using the wrong methods Java classes that you use. You may consult https://docs.oracle.com/javase/8/docs/api to help find the right methods.

Given the following tree traversal methods: Pre-order: Visi…

Given the following tree traversal methods: Pre-order: Visit the root first, then recursively visit all subtrees. In-order (binary tree):  Visit the Left subtree, root, then the right subtree. Post-order: Recursively visit all subtrees, then visit the root.  For each of the following scenarios, select the most appropriate tree traversal method to achieve the desired outcome: A binary search tree stores player scores in its nodes. You want to display scores in ascending order. [a] A tree represents a file system hierarchy. You want to display the file system structure starting from the root, including all  subdirectories and files, mirroring the natural hierarchical listing and exploration of files. [b] A tree represents a file system hierarchy. You want to calculate the total size of a directory, including its subdirectories and files. [c] In Java, garbage collection automatically reclaims memory occupied by objects that are no longer referenced. A tree is used to manage object references, where each node represents an object, and each object can reference other objects. You want to safely delete an object along with all objects it references. [d]     

The Penn Vet Working Dog center maintains a growing database…

The Penn Vet Working Dog center maintains a growing database of registered working dogs. Each dog has a unique name made up of lowercase English letters (‘a’ to ‘z’). To support fast lookup and name-based querying, they use a Trie data structure to store all the dog names.  The system supports the following operations: 1. Insert a new dog name into the Trie. 2. Check whether a dog name is already registered. 3. Find all registered dog names that begin with a given prefix. Assume there are n unique dog names in the database, and each name has a length between 1 and m. Answer the following using Big-O notation: a. What is the maximum depth of the Trie? [depth] b. What is the worst-case time complexity for checking if a dog name exists in the Trie? [time] c. What is the worst-case time complexity of retrieving all dog names that start with a given prefix of length  k, assuming there are r such names and the average length of the r retrieved dog names is l? [autocomplete-time]

Consider the code below which aims to find the minimum diffe…

Consider the code below which aims to find the minimum difference between any two elements in the input array: public int minDiffBetweenElements(int[] arr) {    PriorityQueue minHeap = new PriorityQueue();    for(int i = 0; i < arr.length; i++) {        for(int j = i+1; j < arr.length; j++) {            int diff = Math.abs(arr[i] - arr[j]);            minHeap.add(diff);        }    }    return minHeap.peek();} What is the asymptotic complexity of this method? Select the best answer.

Sam often eats large amounts of food in a short period of ti…

Sam often eats large amounts of food in a short period of time, feeling out of control while doing so. Afterward, she secretly forces herself to vomit and sometimes uses laxatives to prevent weight gain. She is deeply concerned about her body shape and weight. Samantha is most likely experiencing symptoms of:

In the Marvel show Moon Knight Marc frequently experiences b…

In the Marvel show Moon Knight Marc frequently experiences blackouts and wakes up in unfamiliar places with no memory of what happened. He sometimes speaks and behaves as entirely different people, including a British man named Steven and a ruthless vigilante named Jake. Marc’s symptoms are most consistent with: