
sistemas operativos
Publicado por paola rodriguez (5 intervenciones) el 16/04/2013 19:28:05
hola!!
m podrian ayudar con un programa de paginacion de memoria!
esta en bluej!
para el mejor ajust y peor ajust no lo he logrado hacer...

gracias!!
m podrian ayudar con un programa de paginacion de memoria!
esta en bluej!
para el mejor ajust y peor ajust no lo he logrado hacer...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import java.util.Random;
/**
* Write a description of class Memoria here.
*
* @author (your name)
* @version (a version number or a date)
*/
//memoria de 6 datos
public class Memoria
{
// instance variables - replace the example below with your own
private int [] memory;
/**
* Constructor for objects of class Memoria
*/
public Memoria()
{// initialise instance variables
final int SIZE=10;
this.memory=new int [SIZE];
}
/**
* Constructor for objects of class Memoria
*/
public Memoria(int n)
{
// put your code here
this.memory=new int [n];
}
public void llenarMemoria ()
{
Random rnd = new Random();
final int VALOR_MAXIMO= 512;
for(int i=0; i<memory.length; i++)
{
memory[i]=rnd.nextInt(VALOR_MAXIMO) +1;
}
}
public void mejorajuste(int proceso)
{
int menor =proceso;
for(int i=0; i<memory.length; i++)
{
if(memory[i]>=menor)
{
memory[i]=proceso;
}
memory[i]= proceso;
break;
}
}
public void peorajuste(int proceso)
{
int mayor =proceso;
for(int i=5; i<memory.length; i++)
{
if(memory[i]<=mayor)
{
memory[i]=mayor;
}
memory[i]= mayor;
break;
}
}
public void primerajuste(int proceso)
{
int mayor =proceso;
for(int i=1; i<memory.length; i++)
{
if(memory[i]>=proceso)
{
memory[i]=proceso;
}
break;
}
}
}
gracias!!
Valora esta pregunta


0