Commit 2ed8eacb authored by Moïse Destin's avatar Moïse Destin
Browse files

corrige wasted memory

parent b0655a15
Pipeline #4490 passed with stage
in 9 seconds
No preview for this file type
......@@ -4,6 +4,9 @@
<list default="true" id="298fa7eb-9511-4983-9e33-1e1f5e3f9ebe" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Java/Tas.java" beforeDir="false" afterPath="$PROJECT_DIR$/Java/Tas.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Java/TasAjoutCleAleatoire.java" beforeDir="false" afterPath="$PROJECT_DIR$/Java/TasAjoutCleAleatoire.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Java/TasAjoutCleCroissant.java" beforeDir="false" afterPath="$PROJECT_DIR$/Java/TasAjoutCleCroissant.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Java/TasAjoutCleDecroissant.java" beforeDir="false" afterPath="$PROJECT_DIR$/Java/TasAjoutCleDecroissant.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
......@@ -69,7 +72,7 @@
<workItem from="1635251919885" duration="31000" />
<workItem from="1635251962630" duration="689000" />
<workItem from="1635365695090" duration="598000" />
<workItem from="1635770461992" duration="24949000" />
<workItem from="1635770461992" duration="25768000" />
</task>
<servers />
</component>
......
public class Tas {
private static final int d= 2;
private int[] monTas;
private int positionDansTas; // controle reaching capacity d'insertion
private int nombreEchange = 0;
......@@ -73,4 +76,8 @@ public class Tas {
public int getTasSize(){
return monTas.length;
}
public int getNombreDelementStocker() {
return positionDansTas;
}
}
......@@ -36,7 +36,7 @@ public class TasAjoutCleAleatoire {
// S'il y a eu réallocation de mémoire, il a fallu recopier tout le tableau.
swap_analysis.append( tas.getNombreEchange());
// Enregistrement de l'espace mémoire non-utilisé.
memory_analysis.append( a.capacity() - a.size() );
memory_analysis.append( tas.getNombreDelementStocker() - tas.getTasSize() );
}
......
......@@ -34,7 +34,7 @@ public class TasAjoutCleCroissant {
// S'il y a eu réallocation de mémoire, il a fallu recopier tout le tableau.
swap_analysis.append( tas.getNombreEchange());
// Enregistrement de l'espace mémoire non-utilisé.
memory_analysis.append( a.capacity() - a.size() );
memory_analysis.append( tas.getNombreDelementStocker() - tas.getTasSize() );
}
......
......@@ -32,7 +32,7 @@ public class TasAjoutCleDecroissant {
// S'il y a eu réallocation de mémoire, il a fallu recopier tout le tableau.
swap_analysis.append( tas.getNombreEchange());
// Enregistrement de l'espace mémoire non-utilisé.
memory_analysis.append( a.capacity() - a.size() );
memory_analysis.append( tas.getNombreDelementStocker() - tas.getTasSize() );
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment