# Create a stack in c++ for double numbers called xStack

1. Design a stack for double numbers called xStack, which, besides push, pop, isEmpty, peek methods, it has methods for returning the minimum element (min) and the maximum element (max), which should operate in O(1) time, meaning you can't obtain the minimum/maximum by traversing any stack array. xStack should be built using the template class Stack uploaded .

2. Finding the path to the room using the Stack data structure.

A building is represented though a N*M binary matrix of blocks (representing corridors/ stairs, walls and doors). A person, positioned initially at coordinates (0,0) in the building matrix wants to find the door to his room , which has a numerical code (other than 0 and 1): e.g. 101. In the building matrix, we can have 3 types of values: room codes, 0 - means corridors/ stairs, 1 - means walls. A person can go through corridors and stairs till his room . The person can move in any direction (not diagonally) to any matrix block provided the block is not a dead end (walls and doors different from the one he/she is looking for). The task is to check if any path exists so that the person can reach the room and print the path, using the stack data structure.

The input will be 3 building matrices and the code of person's room: the first 2 letters represent the building and the other 3 represent the numerical code inside the building, e.g. MT101.

Example of building matrix for MT building:

MTbuilding[4][5] = {

{0, 104, 0, 0, 1},

{0, 0, 0, 1, 0},

{1, 0, 1, 101, 102},

{0, 0, 0, 0, 0}

}

Example of output, when the person searches for MT101:

Path Found!

The path can be: (0, 0) -> (1, 0) -> (1, 1) -> (2, 1) -> (3, 1) -> (3, 2) -> (3, 3) -> (2, 3)

3. We want to stock all the available rooms in the campus. The rooms are stocked in a priority queue. Implement a template class called PriorityQueue using the xStack class: the rooms are added to the queue in the classical way, at the end of the queue, but when deleting them, the room which is the closest to the building entrance door is selected. In order to calculate the distance between a room and the building entrance door, the distance formula between 2 points is used. The building entrance door has coordinates (0,0). The room doors have coordinates equal to the line and the column in the matrix building.

We need the source files (.cpp and .h) .

A README file in which you will specify all the functional sections of the project, together with instructions for the user; We need a description with every code line of what it does.

Thank you !

Om arbejdsgiveren:
( 0 bedømmelser ) Craiova, Romania

Projekt ID: #19038972

## Tildelt til:

naryl

Hello. The first part (O(1) min/max) can be done by either caching min and max values after every push/pop or by maintaining a secondary internal ordering (which can also be used for the third task's priority queue). T Flere

\$60 USD på 1 dag
(27 bedømmelser)
4.9

## 9 freelancere byder i gennemsnit \$49 på dette job

\$25 USD på 1 dag
(411 bedømmelser)
6.6
idleswell

Hello, I have 25 years experience programming in C++. I will complete these 3 exercises. A milestone payment for the full budget for this project must be deposited with this site before your offer can be accepte Flere

\$137 USD in 3 dage
(70 bedømmelser)
5.1
oyshaobo903

Dear sir I have completed projects similar to your requirement in the past. If you could share your project detail requirements, I will share relevant past work and demo. I already developed 100+ windows applicatio Flere

\$25 USD på 1 dag
(0 bedømmelser)
0.0
msohaibakram

Dear Client, I am highly experienced with C++ development. I have experienc with many projects. Kindly contact me. Thanks

\$90 USD på 1 dag
(0 bedømmelser)
0.0
\$25 USD in 15 dage
(0 bedømmelser)
0.0
Svetrivel2006

Total 18+ years of experience and relevant 9+ years of experience. Expert in data structures, C. worked in embedded domain using C and C++. Created unicode editor for different languages. Have experience in STL usage Flere

\$35 USD in 4 dage
(0 bedømmelser)
0.0