Answer:
The solution is as follows.
class LFilters implements Lock {
int[] lvl;
int[] vic;
public LFilters(int n, int l) {
lvl = new int[max(n-l+1,0)];
vic = new int[max(n-l+1,0)];
for (int i = 0; i < n-l+1; i++) {
lvl[i] = 0;
}
}
public void lock() {
int me = ThreadID.get();
for (int i = 1; i < n-l+1; i++) { // attempt level i
lvl[me] = i;
vic[i] = me;
// rotate while conflicts exist
int above = l+1;
while (above > l && vic[i] == me) {
above = 0;
for (int k = 0; k < n; k++) {
if (lvl[k] >= i) above++;
}
}
}
}
public void unlock() {
int me = ThreadID.get();
lvl[me] = 0;
}
}
Explanation:
The code is presented above in which the a class is formed which has two variables, lvl and vic. It performs the operation of lock as indicated above.
Answer:
a) true.
Explanation:
Encryption is a form of cryptography and typically involves the process of converting or encoding informations in plaintext into a code, known as a ciphertext. Once, an information or data has been encrypted it can only be accessed and deciphered by an authorized user.
Some examples of encryption algorithms are 3DES, AES, RC4, RC5, and RSA.
On the other hand, authentication can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.
Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification.
Digital certificates, smart cards, picture passwords, and biometrics are used to perform an authentication.
<em>Hence, in cybersecurity the use of encryption and authentication protocols is the standard method of countering attempts to alter or insert transmissions. </em>
.
Answer:
Shows the programming checking if num1 is greater than num2
Explanation:
So num1 and num2 are inputs
for you to code this you would need to put
num1=int(input("What is your first number? ))
and the same for num2 except change num1 for num 2 and first for second
When the input is completed, the computer will check if num 1 is greater than num2
it will do this by using a code something like:
if num1>num2:
Print("Your first input was greater than your second")
But in this example if it greater it just ends
But if it was less than you would put
if num1>num2:
Print("Your first input was greater than your second")
elif num1<num2:
Print("Your first input is less than your second")
So basically this code shows the computer checking if one number is greater than the other or not