Answer:
CHAP
Explanation:
CHAP allows a client to be authenticated without sending credential information across a network.
Answer:
Answer provided in screenshot, not really too happy with my implementation but it works.
Explanation:
Iterate through months, handling logic for every 12 months to get the raise.
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:
d) 0 1 1 2
The above piece of code prints the Fibonacci series.
Explanation:
def a(n):
if n == 0:
return 0
elif n == 1:
return 1
else:
return a(n-1)+a(n-2)
for i in range(0,4):
print(a(i),end=" ")