Skip to content

Commit 76131de

Browse files
committed
Improve Look and CLook
1 parent 6af42f5 commit 76131de

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

DiskScheduling/clook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
start = min(arr)
1212
end = max(arr) #Start and End of Head Positions
1313
print(hp, end='')
14-
if(hp<100):
14+
if((abs(hp-start))<(abs(hp-end))):
1515
for i in range(pos, start-1, -1): #Iterates the movement from initial to start of disk
1616
if i in arr:
1717
thm+= abs(pos-i)

DiskScheduling/look.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
start = min(arr)
1212
end = max(arr) #Start and End of Head Positions
1313
print(hp, end='')
14-
if(hp<100):
14+
if((abs(hp-start))<(abs(hp-end))):
1515
for i in range(pos, start-1, -1): #Iterates the movement from initial to start of disk
1616
if i in arr:
1717
thm+= abs(pos-i)

0 commit comments

Comments
 (0)