3 votes

Finding the earliest time we can schedule

A faster way would be to keep track of the amount of resources left. The one aspect that you need to keep in mind with this method is the variable max_required_time....
Tolure's user avatar
  • 186
2 votes

Given two sparse vectors, compute their dot product

Questions: I have written the following code using Hashmap to calculate the dot product for sparse vectors. Compared to using an array, this method seems faster. But I want to get some opinions on ...
user282248's user avatar
2 votes

Given two sparse vectors, compute their dot product

Partly this depends on how sparse the vectors truly are. Obviously, for extremely dense vectors the array method will be faster, and for extremely sparse vectors the map method will be faster; the ...
Reinderien's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible