Update script.js

This commit is contained in:
xixu-me committed 2024-11-28 22:45:02 +08:00
1 parent 7069614624
commit 346da3f39a
1 file changed
+14
+14
View File
@@ -267,3 +267,17 @@ function updateComparisonTable(algorithm, totalSeekTime, order) {
row.cells[1].textContent = totalSeekTime;
row.cells[2].textContent = order.join(" → ");
}
function resetComparisonTable() {
algorithmHistory = {
fcfs: { seekTime: "-", order: [] },
sstf: { seekTime: "-", order: [] },
scan: { seekTime: "-", order: [] },
};
["fcfs", "sstf", "scan"].forEach((algorithm) => {
const row = document.getElementById(`${algorithm}Row`);
row.cells[1].textContent = "-";
row.cells[2].textContent = "-";
});
}