Distinguish between base knowledge and tangential knowledge. Within computer science:
a) base knowledge is knowledge that is required to get an understanding of how things work: e.g. O-notation, (notion of) difference between mean running time and worst case. Mythical Man-Month. If is very important spending time learning this kind of knowledge.
b) tangential knowledge is knowledge you always can read up on at a later time (on a job) when required to: APIs, sort algorithms, including knowing how quicksort works. It is very often a waste of time learning tangential knowledge.
The more you get into academica, the more work you are presented with, and it will be more than you will ever be able to do. You need to be intelligent about where you apply (most of) your effort so you get the most bang for the buck. If you spend too much time learning tangential knowledge, you won't learn the base knowledge and will end up worse than if you slacked but focused on base knowledge.
Whenever you are presented with work, ask yourself: will doing this provide me with more understanding, or is it just more of the same I've already done. You are not given work just to do the work, you are given the work as an opportunity to learn.
tl;dr: If a part of your homework doesn't make you learn anything, there is no reason performing it.