Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2148cd5

Browse files
committedOct 15, 2024·
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4c679a1 commit 2148cd5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎greedy_methods/fractional knapsack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
def greedy_knapsack(n, w, p, m):
22
ratio = [0] * n
3-
3+
44
# Calculate the ratio of profit/weight
55
for i in range(n):
66
ratio[i] = p[i] / w[i]
@@ -31,5 +31,5 @@ def greedy_knapsack(n, w, p, m):
3131
w = list(map(int, input("Enter the object weights: ").split()))
3232
p = list(map(int, input("Enter the profit: ").split()))
3333
m = int(input("Enter maximum capacity: "))
34-
34+
3535
greedy_knapsack(n, w, p, m)

0 commit comments

Comments
 (0)
Please sign in to comment.