Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- Write a program that ask the user far a file - That file contains a matrix of numbers (only 1,0 and 1 ) -

image text in transcribedimage text in transcribed

- Write a program that ask the user far a file - That file contains a matrix of numbers (only 1,0 and 1 ) - The first two lines of the file will be the size of the rows and columns - You can assume the data in the file is correct - Your program should stare the values of the matrix af a vectors of int vectors. - Your program should then find a cantinuous path thought the matrix starting at the top left and moving to the botton right 0 The path must have the same number of 1 's and - 1 's. The number of zeros do nat matter - Your program should only move left (col -1), righticol +1 ), up (row -1) and down (row +1). - Your path can only use a pasitian once - If there is such a path in the matrix, that path should be printed to console, using ' A ' for down, 'n' for up, ' > ' for right, ' ' for left, ' x ' 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4. How is culture a contested site?

Answered: 1 week ago