Give a greedy algorithm for Binary Knapsack that runs in O(n log n) time, where n is the number of items to consider, and achieves at least half the maximum profit when all the items have the same profit-to-weight ratio. Explain why your algorithm achieves this

Give a greedy algorithm for Binary Knapsack that runs in O(n log n) time, where n is the number of
items to consider, and achieves at least half the maximum profit when all the items have the same
profit-to-weight ratio. Explain why your algorithm achieves this