The stack-based routing scheme

Assignment Help C/C++ Programming
Reference no: EM13165733

 the stack-based routing scheme you are to have a stack of maze locations. Place the location that Noodles

starts at in the stack. And then do the following:

1. Pop the next location.

2. Push all locations next to the location you just Pop which are empty spaces (blanks) that have never

before been Pushed. Remember that Noodles can only travel north, south, east or west, so diagonal

spaces are not considered next to each other. As you Push these spaces, check to see if any of them hold

the cheese. If none of them do, go back to step 1.

3. Clearly you have found a route from Noodles to the cheese, but exactly what that route may not be clear

to poor Noodles (or yourself!) So you need to figure out what route Noodles should take. Your route

should not backtrack onto itself. That is, it should not require Noodles visiting the same square twice.

 

 

 

e) Create a stack of rooms;

f) Make the start cell position the mouse position;

g) Mark the current position "Visited"

h) Start Timer

i) While the current cell position is not the goal position

i) Find an open adjacent cell neighboring the current cell position (one

cell to the right, below, left, or above);

(1) If there are multiple ways to go Mark as an intersection point

ii) If an open neighbor cell was found

(1) Push the current position onto the stack;

(2) Make the open neighbor cell the current position;

(3) Mark the current cell position "Visited";

iii) else

(1) do

(a) Mark the current cell position "Rejected";

(b) if the stack is empty

1. No Path Exist

(c) Pop the top of the stack into the current cell position;

(2) While stack is not empty or current does not contains an

Intersection room

j) End while

k) Push the current position (the goal) onto the stack.

l) Stop the timer

m) Print Out the Solved Maze and Time.

 

 

int stackSolution(Room maze[][MAXSIZE], int currentSize)

{

 

}

 

 

Reference no: EM13165733

Questions Cloud

Define get and set functions and two constructors : Create a class called Building. It will have one data member of type string (used for a postal address). Define get and set functions and two constructors.
State what is the kinetic energy of an electron : Electrons are ejected from sodium metal by any light that has a wavelength shorter than 544 nm. What is the kinetic energy of an electron
Mick''s wicks makes candles in various sizes : Mick's Wicks makes candles in various sizes. Create a class for the business named Candle that contains data fields for color, height, and price. Create get methods for all three fields
Print the number of lines the number of words : a java program where im supposed to print the number of lines the number of words and the longest line in a text file!
The stack-based routing scheme : the stack-based routing scheme you are to have a stack of maze locations.
Create a sequentially numbered array : Create a sequentially numbered array of 50 integers. Then use the Random_range procedure to shuffle the array in a random order.(Each number will only appear once in the array.) Display the shuffled array.
Write vhdl code to compile the greatest common divisor : Write VHDL code to compite greatest common divisor of two integers using Euclidean algorithm
State electrons are ejected from sodium metal by any light : Electrons are ejected from sodium metal by any light that has a wavelength shorter than 544 nm. What is the kinetic energy of an electron
Write a user-defined matlab function : Write a user-defined MATLAB function that calculate the condition number of an (nxn) matrix by using the 1-norm. for the function name and arguments use c = condNum_one(A).

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd