Binary search from Labyrinth
$30-50 USD
Paid on delivery
Implement DFS alogorithm. Need C++ or C or Java
You are given a labyrinth as a graph whose vertices are integers between 0 and 1,000,000.
Each vertex has at most four neighbors, given by four functions; each of these filnctions
maps integers to integers. If applied to an integer representing a vertex, the function
either returns another vertex, or -1, which represents no vertex; but it might generate an error if applied to a number which does not represent a vertex.
Implement the DFS algorithm and provide two functions
- int l-size(int start, int ( * f 1 ) ( i n t ) , int (*t2) ( i n t ) ,
int (*f3) (int), int (*f4) ( i n t ) )
which gives the total number of vertices in the labyririth, and
.
- int l-distance(int start, int target, int ( * f 1 ) ( i n t ) , int ( * f 2 ) ( i n t ) ,
int (*f3) (int) , int (*f4) (int) )
which gives the length of the shortest path from start to target.
The programming language is C or C++; test your code before submission using the gcc or 8++ compiler'
Project ID: #3112100