1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
OLEGan [10]
3 years ago
11

Please check my answer! (Java)

Computers and Technology
2 answers:
Musya8 [376]3 years ago
6 0

I think it is right.

EleoNora [17]3 years ago
3 0

im pretty sure you answered correctly if not sorry:)

You might be interested in
The L-exclusion problem is a variant of the starvation-free mutual exclusion problem. We make two changes: as many as L threads
vladimir2022 [97]

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.

6 0
3 years ago
When light does not pass through or bounce off an object, it is said to be
Dmitry [639]
The object is said to be absorbed
3 0
3 years ago
Read 2 more answers
Global visibility is: Group of answer choices A visibility type where an object A has a semi-permanent reference to another obje
polet [3.4K]

Answer:

the visibility persists as long as both A and B exist.

Explanation:

Global visibility basically means that the visibility persists as long as both A and B exist. In programming global visibility signifies that the variable/data in question is visible from any context of the code. Meaning that it can be accessed and manipulated from any part of the code, even from within a function or another document. This makes it very easy to use and structure accordingly.

5 0
3 years ago
How do I write a pseudocode algorithm to read a sequence of number terminated by the number 999 and print the sum of the positiv
Veronika [31]

Answer:Start with the algorithm you are using, and phrase it using words that are easily transcribed into computer instructions.

Indent when you are enclosing instructions within a loop or a conditional clause Avoid words associated with a certain kind of computer language.

Explanation:

5 0
3 years ago
Select the correct answer.
zmey [24]

the answer should be the letter a

3 0
3 years ago
Read 2 more answers
Other questions:
  • Question: A famous Disney Movie partially takes place in this city.
    15·2 answers
  • I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if
    5·1 answer
  • The second row of letters on the keyboard is called the______ row
    14·2 answers
  • Difference between change management n asset management
    11·1 answer
  • Pinterest, a visual bookmarking Website, logs more than 14 terabytes of new data each day, which means its storage needs are con
    10·1 answer
  • Match each word to its correct meaning.
    5·1 answer
  • Science can give us
    5·2 answers
  • Citing Wikipedia as a reference is not considered a good practice because 1.leverages a neutral point of view. 2.hosts unopinion
    8·1 answer
  • cout &lt;&lt; "Part 1" &lt;&lt; endl; // Part 1 // Enter the statement to print the numbers in index 4 and index 9 // put a spac
    11·1 answer
  • Analyze the error in the html code :<br><br> HTML
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!