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
UNO [17]
3 years ago
11

What is the available vector for each resource and the need matrix for each thread. Note that an available vector depicts the qu

antities of resources of each type that are available in the system after current allocation. The need matrix depicts of the quantities of resources of each type still needed by each thread, with each column corresponding to a thread and each row corresponding to a resource and an entry in location [i, j] of the matrix showing the quantity of a resource rj still needed by a thread ti.

Computers and Technology
1 answer:
blsea [12.9K]3 years ago
4 0

Answer:

If request granted then T₁ and T₂ are in deadlock.

Explanation:

See attached image

You might be interested in
Use the STL class vector to write a C function that returns true if there are two elements of the vector for which their product
Tema [17]

Answer:

Code is provided in the attachment form

Explanation:

Vector Multiplication code:

Vector_multiplication.c file contains C code.

See attachment no 1 attached below

Classification of Algorithm: For creating elements in vector c of size n, number of scalar  multiplications is equal to n. The size of original two vectors scales directly with the number of  operations. Hence, it is classified as O(n).

7 0
3 years ago
What are the reasons why is it necessary to evaluate online sources and content?
marissa [1.9K]
1) You don't know if the source is reliable. 
2) It is better to cite reliable sources so.
7 0
3 years ago
Is the movie IT really that scary ? Rate between 1-10, 10 being I had nightmares
mezya [45]
5 I don’t think it’s good. I thought it was boring.
4 0
3 years ago
HELP I am in the computer lab right now and I need legit reasons why i should work on a laptop instead of a computer. I dont lik
8_murik_8 [283]
Just be honest with your teacher. And say, "I'd rather work on my laptop, cause i feel uncomfortable on one of these computers." And you could say.. " I can save my work on here, so i dont lose anything if that computer messes up."
3 0
3 years ago
Read 2 more answers
Write a program that will read in a line of text and output the number of words in the line and the number of occurrences of eac
kherson [118]

Answer:

Here is the C++ program:

#include<iostream>  //to use input output functions

#include <algorithm>  //to use tolower() function

using namespace std;  //to identify objects like cin cout

int main() {  //start of main function

 string text;  // to hold text input

 cout<<"Enter a line of text: ";  // prompts user to enter a string

 getline(cin,text);  // reads the input string (text) from user

transform(text.begin(), text.end(), text.begin(), ::tolower);  //converts the text into lower case

 int letter[26] = {0}; //to hold the letters

 int i;  // used as a loop variable

 int words=0;  // to hold the count of words

 for(i = 0; i< text.size();i++){  // iterates through the text

 if(isalpha(text[i])&&(text[i+1]=='.'||text[i+1]==','||text[i+1]==' '))  //checks if the character at i-th index of text is a letter, and checks if i+1 index position of text is a period, comma or a space

 words++;  // adds 1 to the count of words

 if(isalpha(text[i]))  // if the character at the i-th index of text is a letter

 letter[text[i]-'a']++;  }  // counts the occurrences of each letter

 char j = text[text.size()-1];  // sets j to the last character of text

 if(j != '.' && j!= ' '&& j!=',' &&j!= '\0')  //if the last character is not a period or empty space  or comma or end of lone

 words++;  //add 1 to the count of words

 cout<<"Number of words: "<<words<<endl;  //display the number of words in the text

 for(i=0; i<26; i++)  {  //iterates 25 times

   if(letter[i]>0)  //if letter at index i is greater than 0

   cout<<(char)('a'+i)<<" : "<<letter[i]<<endl;  }} //displays each letters and its number of occurrences in the text

 

Explanation:

The program is explained in the attached document with an example.

7 0
3 years ago
Other questions:
  • Consider a file system that uses inodes to represent files. Disk blocks are 2KB in size and a pointer to a disk block requires 4
    13·1 answer
  • Describe how computer is in the last 35 years
    6·1 answer
  • Notice in the topology there are 3 network ranges that would be translated based on the ACL created. What will happen if more th
    6·1 answer
  • There are many different types of decision-making. Which of the following is NOT a type of decision-making? a. fiat rule b. sing
    15·2 answers
  • Describe at least three virus scanning techniques
    13·1 answer
  • Two strings, and , are called anagrams if they contain all the same characters in the same frequencies. For example, the anagram
    13·1 answer
  • Write a game that plays many rounds of Rock Paper Scissors. The user and computer will each choose between three items: rock (de
    8·1 answer
  • how do I delete my brainly account, my child signed up for it and nothing has been paid but I do not want the account to exist a
    7·2 answers
  • Which of the following is not a language commonly used for web programming?
    8·2 answers
  • Which of the following correctly orders the units of measure from least to greatest?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!