// depth first search from vertex 0
// this is simple-minded and will display all vertices as
// visited in depth first search
//  By default it starts from vertex 0 but easy to change if wanted
using namespace std;
#include <iostream>
#include <stack>
const int MAXSIZE = 100;
void dfs(int matrix[MAXSIZE][MAXSIZE], int n);
void readMatrix(int matrix[MAXSIZE][MAXSIZE], int &n);
int getAdjacent(int matrix[MAXSIZE][MAXSIZE], int n, bool visited[],int current);

int main ()
{
   int matrix[MAXSIZE][MAXSIZE] = {0};
   int n;
   readMatrix(matrix,n);
   dfs(matrix,n);
   system("pause");
   return 0;
}

void readMatrix(int matrix[MAXSIZE][MAXSIZE], int &n)
{
  // reads in number of vertices and sets n to number of vertices
  // reads in matrix
  // assumes all input is correct
 
  cout << "Enter number of vertices " << endl;
  cin >> n;
  cout << "Enter matrix " << endl;
  for (int r = 0; r < n; r++)
    for (int c = 0; c < n; c++)
       cin >> matrix[r][c];
}

void dfs(int matrix[MAXSIZE][MAXSIZE], int n) 
{
// depth first search of matrix uses a stack
// starts from vertex 0
   bool visited[MAXSIZE] = {false};
   stack <int> s;  

   int current = 0;  // start from vertex 0
   visited [current] = true;
   s.push(current);
   cout << current << endl;

   // complete this part

} 


int getAdjacent(int matrix[MAXSIZE][MAXSIZE], int n, bool visited[],int current)
{
   // return next unvisited adjacent vertex to
   // current or -1 if none exists
   // complete this part
}

