It depends on the early development of the fish, if it is only exposed to some kinds of algae it'll aim toward those more later on in time. if it is never expose to algae and only shrimp pellets etc then it'll most likely stay away from algae.
example would be otos, in the wild they eat algae and when brought in they usually die because there isn't enough algae to sustain them over time.. and if are converted to shrimp pellets etc then they'll eat both.