Question: Write a program that ask the user o a file that contains a matrix of characters ( - or +) The first two lines of
Write a program that ask the user o a file that contains a matrix of characters ( - or +) The first two lines of the file will be the size of the rows and columns o and a length of a sequence Your program should store the values of the matrix of a vectors of char vectors. Your program should then find a continuous path thought the matrix o The path should be sum to zero + will add one to the total - will subtract one from the total o The path should be the length the user inputted o Your program should only move left (col -1), right(col +1), up (row -1) and down (row+1). o Your path can only use a position once If there is such a path in the matrix, that path should be printed to console, using V for down, ^ for up, > for right,< for left, * where the path ends and - for all other positions in the matrix. You must write a function called path_finder to find the path thought the matrix this function needs be recursive.
test1
5 6 - - - + + - - + + - - + + - - + - - - - + + - - - - + + + +
test2
3 3 - - - - + + - - +
test3
3 3 - - - - - + - - +
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
