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
vivado [14]
3 years ago
6

A disk drive has 2000 cylinders, numbered 0 to 1999. The drive is currently servicing a request at cylinder 783, with the previo

us request at cylinder 707. The queue of pending requests, in FIFO order, is 75, 678, 1623, 247, 248, 1529, 182. What distance, in tracks, must the disk read-write arm move in order to service the requests for each of the following disk scheduling algorithms?
a) FCFS
b) SSTF
c) SCAN
d) LOOK
e) C-SCAN
f) C-LOOK
Computers and Technology
1 answer:
Ket [755]3 years ago
5 0

Answer:

Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is

Explanation:

You might be interested in
Descending selection sort with output during execution
FromTheMoon [43]

Answer:

Check the explanation

Explanation:

Please find the code down

def selection_sort_descend_trace(numbers):

i=len(numbers)

print("Output: ")

for num in range(0,i-1):# traversing from 0 to N-2, total N-1 iterations

val=numbers[num]

start=num+1

end=i

t=0

for j in range(start,end):

if(val<numbers[j]):

remember=j

val=numbers[j]

t=1

if(t==1):# swaping onlf if greater number is available

temp=numbers[num]

numbers[num]=val

numbers[remember]=temp

for p in range(i):# printing

print(numbers[p],end=' ')

print("\n")

if __name__ == "__main__":

print("Enter the integers separated by space: ")

numbers=[int(x) for x in input().split(' ')]

selection_sort_descend_trace(numbers)

Taking input as string and splitting with space as delimiter , converting the split part to integer , finally append in the list.

3 0
3 years ago
Katarina is deciding whether to buy a desktop or a laptop computer. What will most likely help Katarina make her decision?
Gnesinka [82]
Laptops are portable decides , while desktops remain in one plcae
4 0
3 years ago
Read 2 more answers
Question 2 (2 points)
bezimeni [28]

You can add a bookmark by clicking the star icon

<u>Explanation:</u>

Sometime you may have to visit a same page many times. It will be very difficult to search every time and go to the same page. It will be waste of time. Hence, there is an option available so that you can visit the page that you want to access many time without wasting your time.

In order to visit the page that you want to access more frequently you can use two ways. Most of the browsers will support to visit the most frequently accessed websites using the keyboard shortcuts Ctrl+D. You can also click on the star icon that is present in the address bar of the browser's top portion.

3 0
3 years ago
30 points) Suppose you are given a string containing only the characters ( and ). In this problem, you will write a function to
navik [9.2K]

Answer:

The screenshot is attached below

Explanation:

The below program check balence of paranthesis using stack.

if the input charecter is ( then push to stack

if the input charecter is ) then pop top element and compair both elements for match.

Program:

public class Main

{

static class stack // create class for stack

{

int top=-1; // initialy stack is empty so top = -1

char items[] = new char[50]; // Create an array for stack to store stack elements

 

void push(char a) // Function push element to stack

{

if (top == 49) // chack stack is full ?

{

System.out.println("Stack full");

}

else

{

items[++top] = a; // increment the array index and store the element

}

}

 

char pop() // function to return the elements from stack

{

if (top == -1) // check the stack is empty

{

System.out.println("Empty stack");

return '\0';

}

else

{

char element = items[top]; // return the top element

top--; // Decrement the array index by one

return element;

}

}

 

boolean isEmpty() // Check the stack is empty or not

{

return (top == -1) ? true : false;

}

}

static boolean isMatch(char character1, char character2) // Check the input charecters are matching pairs or not

{

if (character1 == '(' && character2 == ')') // If they match return true

return true;

else

return false;

}

 

static boolean isBalanced(String parantheses) // check the input string is balenced or not

{

char[] exp = new char[parantheses.length()]; // Create a charecter array

for (int i = 0; i < parantheses.length(); i++) { // Convert the string parantheses to charecter array

exp[i] = parantheses.charAt(i);

}

stack st=new stack(); // Declare an empty character stack    

for(int i=0;i<exp.length;i++)

{  

if (exp[i] == '('))   // if input charecter is '(' push to stack

st.push(exp[i]);

if (exp[i] == ')') // if input charecter is ')' pop top element from stack

{

if (st.isEmpty())

{

return false;

}

 

else if ( !isMatch(st.pop(), exp[i]) ) // Call isMatch function

{

return false;

}

}

 

}

 

if (st.isEmpty())

return true; //balanced

else

{

return false; //not balanced

}

}

 

 

public static void main(String[] args)

{

 

System.out.println(isBalanced("()()()")); // Output true if string is balenced

 

}

 

}

Screenshot:

5 0
2 years ago
write code that removes the first and last elements from a list stored in a variable named my_list. assume that the list has bee
MakcuM [25]

Answer:

[24, 35, 9, 56 Approach #3: Swap the first and last element is using tuple variable.

8 0
2 years ago
Other questions:
  • Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f
    6·1 answer
  • Prior to the development of e-commerce, web sites primarily delivered static html pages. true
    11·1 answer
  • which one of these steps describe saving a newly created file. click on the save icon. minimize the file. name the file. select
    12·2 answers
  • What did Fulton design in addition to the steamboat
    5·1 answer
  • Digital libraries are often available to students and/or employees at colleges, schools, and BLANK institutions.
    15·1 answer
  • The Rule of Thirds is a way to:
    14·1 answer
  • If you do not specify any criteria in a delete query, Access will delete all the records in the table. Truth or False
    11·1 answer
  • What values can represent a bit
    8·1 answer
  • Lasses give programmers the ability to define their own types. <br><br> a. True<br> b. False
    10·1 answer
  • What is referential integrity
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!