Answer:
In terms of efficient use of memory: Best-fit is the best (it still have a free memory space of 777KB and all process is completely assigned) followed by First-fit (which have free space of 777KB but available in smaller partition) and then worst-fit (which have free space of 1152KB but a process cannot be assigned). See the detail in the explanation section.
Explanation:
We have six free memory partition: 300KB (F1), 600KB (F2), 350KB (F3), 200KB (F4), 750KB (F5) and 125KB (F6) (in order).
Using First-fit
First-fit means you assign the first available memory that can fit a process to it.
- 115KB will fit into the first partition. So, F1 will have a remaining free space of 185KB (300 - 115).
- 500KB will fit into the second partition. So, F2 will have a remaining free space of 100KB (600 - 500)
- 358KB will fit into the fifth partition. So, F5 will have a remaining free space of 392KB (750 - 358)
- 200KB will fit into the third partition. So, F3 will have a remaining free space of 150KB (350 -200)
- 375KB will fit into the remaining partition of F5. So, F5 will a remaining free space of 17KB (392 - 375)
Using Best-fit
Best-fit means you assign the best memory available that can fit a process to the process.
- 115KB will best fit into the last partition (F6). So, F6 will now have a free remaining space of 10KB (125 - 115)
- 500KB will best fit into second partition. So, F2 will now have a free remaining space of 100KB (600 - 500)
- 358KB will best fit into the fifth partition. So, F5 will now have a free remaining space of 392KB (750 - 358)
- 200KB will best fit into the fourth partition and it will occupy the entire space with no remaining space (200 - 200 = 0)
- 375KB will best fit into the remaining space of the fifth partition. So, F5 will now have a free space of 17KB (392 - 375)
Using Worst-fit
Worst-fit means that you assign the largest available memory space to a process.
- 115KB will be fitted into the fifth partition. So, F5 will now have a free remaining space of 635KB (750 - 115)
- 500KB will be fitted also into the remaining space of the fifth partition. So, F5 will now have a free remaining space of 135KB (635 - 500)
- 358KB will be fitted into the second partition. So, F2 will now have a free remaining space of 242KB (600 - 358)
- 200KB will be fitted into the third partition. So, F3 will now have a free remaining space of 150KB (350 - 200)
- 375KB will not be assigned to any available memory space because none of the available space can contain the 375KB process.
Answer:
// here is code in java.
public class NAMES
{
// main method
public static void main(String[] args)
{
int n=4;
// print the upper half
for(int a=1;a<=n;a++)
{
for(int b=1;b<=n-a;b++)
{
// print the spaces
System.out.print(" ");
}
// print the * of upper half
for(int x=1;x<=a*2-1;x++)
{
// print the *
System.out.print("*");
}
// print newline
System.out.println();
}
// print the lower half
for(int y=n-1;y>0;y--)
{
for(int z=1;z<=n-y;z++)
{
// print the spaces
System.out.print(" ");
}
for(int m=1;m<=y*2-1;m++)
{
// print the *
System.out.print("*");
}
// print newline
System.out.println();
}
}
}
Explanation:
Declare a variable "n" and initialize it with 4. First print the spaces (" ") of the upper half with the help of nested for loop.Then print the "*" of the upper half with for loop. Similarly print the lower half in revers order. This will print the required shape.
Output:
*
***
*****
*******
*****
***
*
Answer:
Most injury crashes in Florida happen in dusk conditions
Explanation:
Dusk is the time of the day when the sun is setting. At this time of the day, the visibility on the roads is less. This time of the day, the number of cars on the roads is also significantly greater. This indirectly means that the possibility of most injury crashes in Florida in dusk conditions considerably increases.
The amount of tourism happening in the state is also a condition that takes part in injury crashes due to increased traffic on the roads.