Answer:
Advantages of DHT with mesh overlay topology
- A single hop is used to route a message to the peer, the nearest key is used route message between points
- There are bi-directional links between each pair of peers other than the broadcasting peer therefore creating a multiple delivery paths from source to other peers
Disadvantages of DHT with mesh overlay topology
- complexity of the design of a Mesh overlay Topology
- Consuming process ( tracking of all peers by each peer )
Advantages of circular DHT ( with no shortcuts )
- less consuming process ( each peer tracks only two peers )
Disadvantages of Circular DHT ( with no short cuts )
- The number of messages sent per query is minimized
- 0(N) hopes are required to route message to a peer responsible for the key
Explanation:
Advantages of DHT with mesh overlay topology
- A single hop is used to route a message to the peer, the nearest key is used route message between points
- There are bi-directional links between each pair of peers other than the broadcasting peer therefore creating a multiple delivery paths from source to other peers
Disadvantages of DHT with mesh overlay topology
- complexity of the design of a Mesh overlay Topology
- Consuming process ( tracking of all peers by each peer )
Advantages of circular DHT ( with no shortcuts )
- less consuming process ( each peer tracks only two peers )
Disadvantages of Circular DHT ( with no short cuts )
- The number of messages sent per query is minimized
- 0(N) hopes are required to route message to a peer responsible for the key
Distributed hash table (DHT) is a distributed system that provides a lookup service similar to a hash table. in the DHT key-value are stored in it
Complete Question:
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:
Enter a number (<100):
Enter a number (<100):
Enter a number (<100):
Your number < 100 is: 25
Answer:
import java.util.Scanner;
public class num8 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n;
do{
System.out.println("Enter a number (<100):");
n= in.nextInt();
}while(n>100);
System.out.println("Your number < 100 is: "+n);
}
}
Explanation:
Using Java programming language
Import the scanner class to receive user input
create an int variable (n) to hold the entered value
create a do while loop that continuously prompts the user to enter a number less than 100
the condition is while(n>100) It should continue the loop (prompting the user) until a number less than 100 is entered.
COMPLETE QUESTION:
Write a function nexthour that receives one integer argument, which is an hour of the day, and returns the next hour. This assumes a 12-hour clock; so, for example, the next hour after 12 would be 1. Here are two examples of calling this function.
>> fprintf('The next hour will be %d.\n', nexthour(3))
the next hour will be 4
>> fprintf('The next hour will be %d.\n', nexthour(12))
the next hour will be 1
Answer:
The following CODE in MATLAB will accomplish this
<em>>> nexthour = input('Please enter a time here: ');</em>
<em>if (nexthour >= 1) && (nexthour< 12)</em>
<em>nexthour = nexthour+ 1</em>
<em>elseif (nexthour == 12)</em>
<em>nexthour = 1</em>
<em>else </em>
<em>disp('You entered an invalid time')</em>
<em>end</em>
Explanation:
In the Matlab code above, the input function is used to receive a value for time in hours (1-12) next we use the if statement to check that the time entered is between 1 and 11 and add 1 as the next hour, else if the value entered is 12, we assign 1 as the next hour. For every other inputs an error message is displayed.
Answer:
UPDATE COMPANY
SET COMM=COMM + 500
WHERE SALES> 20000;
Explanation:
The update command is used for alter the record in the database management system in the table .The update command command modify the record on the some condition in the table in the database management system.
Following are syntax for using the update command .
UPDATE table-name
SET column name 1,column name 2 .........
Where condition
- In the given question table -name is "COMPANY" the condition is on the sales column and it update the table only when sales is more than 20000 and set the column COMM by 500.