Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In an attached txt file the first line represents the number of buildings in hot

ID: 3698340 • Letter: I

Question

In an attached txt file the first line represents the number of buildings in hotel, the second line represents the number of rooms in the building and the third line represents the room number and capacity respectively. Make a hotel reservation in which you ask the user the room number to reserve, Using the concept of binary search trees in C++ output the number of rooms reserved in the building as well the number of available rooms.                                                                                                         Below is the content of the txt file:                                                                                                

Explanation / Answer

#include<iostream.h>

#include<stdio.h>

void main()

{

ifstream f;

f.readfile('read.txt");

f.open();

while(f.eof)

{

function binarySearch(values, target, start, end) {

if (start > end) { return -1; } //does not exist

var middle = Math.floor((start + end) / 2);

var value = values[middle];

if (value > target) { return binarySearch(values, target, start, middle-1); }

if (value < target) { return binarySearch(values, target, middle+1, end); }

return middle; //found!

}

}

]

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote