@@ -0,0 +1,1811 @@
+package com.company;%0A%0Aimport java.util.*;%0A%0Apublic class JTree %7B%0A%0A    public Map%3CJVertex,List%3CJVertex%3E%3E structure = new HashMap%3C%3E();%0A%0A    public void addVertex(JVertex v)%7B%0A        structure.put(v,new LinkedList%3C%3E());%0A    %7D%0A%0A    public boolean addEdge(JVertex source, JVertex destination)%7B%0A%0A        if (!structure.containsKey(source) %7C%7C !structure.containsKey(destination)) %7B%0A            return false;%0A        %7D%0A       return structure.get(source).add(destination);%0A    %7D%0A%0A    public int size()%0A    %7B%0A        return structure.keySet().size();%0A    %7D%0A%0A    public int getDegree(JVertex v)%7B%0A        return structure.get(v).size();%0A    %7D%0A%0A    public void breadthFirstSearch(JVertex v)%7B%0A        Queue%3CJVertex%3E queue = new LinkedList%3C%3E();%0A        List%3CJVertex%3E visited = new LinkedList%3C%3E();%0A        queue.add(v);%0A        while (!queue.isEmpty())%7B%0A            JVertex vertex = queue.poll();%0A            if (!visited.contains(vertex))%7B%0A                visited.add(vertex);%0A                System.out.println(vertex.value);%0A                List%3CJVertex%3E adjacentVertices = structure.get(vertex);%0A                for (JVertex u:adjacentVertices) %7B%0A                    queue.offer(u);%0A                %7D%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A    public void depthFirstSearch(JVertex v)%7B%0A        Deque%3CJVertex%3E stack = new ArrayDeque%3C%3E();%0A        List%3CJVertex%3E visited = new LinkedList%3C%3E();%0A        stack.push(v);%0A        while (!stack.isEmpty())%7B%0A            JVertex vertex = stack.pop();%0A            if (!visited.contains(vertex))%7B%0A                visited.add(vertex);%0A                System.out.println(vertex.value);%0A                List%3CJVertex%3E adjacentVertices = structure.get(vertex);%0A                for (JVertex u:adjacentVertices) %7B%0A                    stack.push(u);%0A                %7D%0A            %7D%0A        %7D%0A%0A    %7D%0A%0A%0A%7D%0A%0A

Create Jtree.java