Examlex

Solved

For the Questions Below, Consider the Following Representation of Grid

question 4

Multiple Choice

For the questions below, consider the following representation of grid and the maze code from Chapter 11.
Grid:
1 1 1 1 1 1 0 0
0 0 1 0 0 1 0 0
0 0 1 0 0 1 1 0
0 0 1 1 0 0 1 0
0 0 0 1 1 0 0 0
0 0 0 0 1 1 1 1
Code:
public boolean traverse(int row, int column)
{
if (valid(row, column) )
{
boolean done = false;
grid[row][column] = TRIED;
if (row == grid.length - 1 && column == grid[0].length - 1)
done = True;
else
{
done = traverse(row + 1, column) ;
if (!done) done = traverse(row, column + 1) ;
if (!done) done = traverse(row - 1, column) ;
if (!done) done = traverse(row, column - 1) ;
}
if (done) grid[row][column] = PATH;
}
return done;
}
Assume valid returns True if row and column are >= 0 and <= the grid's row length or column length and the entry at this position = = 1. And assume TRIED = 3 and PATH = 7
-Which of the following grids would be the result after traverse has completed all of its recursive calls?


Definitions:

Synaptic Integration

The summing of excitatory and inhibitory signals by a postsynaptic cell.

Postsynaptic Neuron

The neuron on the receiving end of a synapse, which receives signals from another neuron (the presynaptic neuron) through neurotransmitters.

Excitatory

Pertains to stimuli or substances that increase neuronal activity or facilitate the firing of neurons.

Inhibitory

Pertains to any process or substance that slows down or stops a particular reaction or activity.

Related Questions