Answer:
Explanation:
Algorithm:
a. In each day, you will have to loop through the hotels that come to the hotel after you stayed last night.
b. If a hotel 'h' is found at more than 'd' distance away from last stayed hotel, then the hotel previous of 'h' is chosen to wait for that night. This is the greedy step, and you stay in this hotel.
c. The process for steps a and b is then repeated until we've reached the last hotel xn.
Running time:
Notice that the worst case occurs if each hotel is at a distance of successive multiples of 'd'. The best move is to estimate the distance to each hotel twice the whole computation in the scenario.
Thus, the total running time that could occur in the worst case is O(2n) = O(n). This is said to be linear time.
Answer:
ASP.NET ,C#.NET,SQLServer,HTML,JavaScript
Explanation:
To build any web based application we need one presentation layer(HTML)
and for client side scripting JavaScript.
ServerSide ASP.NET Technology and C#.NET to write your business layer
Sql programming to store data in sql server
Answer:
15
Explanation:
The if else state is used for checking the condition and if the condition is TRUE and program can execute the statement within the if else.
Initially input_value is 5
then the if statement check the condition 5>5, condition FALSE because 5==5
it not less than 5.
then program move to else if and check condition 5>2, condition TRUE.
then, input_value = 5 + 10=15 execute and update the value to 15.
After that, program terminate the if else statement.
Therefore, the answer is 15.