Use c++ language and answer all three questions. All four functions are provided belowe. Please use these functions nothing else.Thanks.
/********************************************************************************************************
* QUESTION 1 *
* Write a function that prints the expression associated with the given tree rooted at the given node. *
* Note that the edges of T will be directed away from the root. *
* ******************************************************************************************************/
void printExpression(Graph T, int root)
{
need coding..........
}
/****************************************************************************************************************************************************
* QUESTION 2 *
* Write a function that makes and returns an n by m grid graph. Vertices must be labeled in increasing order from left to right and top to bottom. *
* **************************************************************************************************************************************************/
Graph makeGrid(int n, int m)
{
need coding..........
Graph G;
return G;
}
/***********************************************************************************************************
* QUESTION 3 *
* Write a function that, given a directed graph, fills vectors with tree, forward, back, and cross edges. *
* *********************************************************************************************************/
//This function signature is provided if you would like to use it but you are not required to do so
int classifyEdgesRecur(int s, int time, Graph &G, vector<Edge> &tree, vector<Edge> &forward, vector<Edge> &back, vector<Edge> &cross)
{
need coding..........
return -1;
}
void classifyEdges(Graph &G, vector<Edge> &tree, vector<Edge> &forward, vector<Edge> &back, vector<Edge> &cross)
{
need coding..........
}
Use c++ language and answer all three questions. All four functions are provided belowe. Please use these functions noth
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am