Consider the Graph class stub in C# given below, which was u…
Consider the Graph class stub in C# given below, which was used in Lab 2. As the producer of the Graph class, write a method which accepts an array of integers as input, and determines whether the elements of the array form a cycle (ordered by array index). class Graph { private object edges; public Graph(int numVertices) { … } public int getNumVertices() { … } public void addVertexData(int vertexNumber, object vertexData) { … } public void addEdge(int vertex1, int vertex2) { … } public void removeEdge(int vertex1, int vertex2) { … } public bool hasEdge(int vertex1, int vertex2) { … } public object getVertexData(int vertexNumber) { … } public bool isConnected() { … } public bool hasCycle() { … } public bool isTree() { … } private int[] depthFirstSearch(int s) { … } //more private methods below }