A langauge with strong typing and bound checking is ideal when you're learning algorithms. A newbie coding a bubble sort in Pascal encounters less mysterious failure modes than a newbie coding a bubble sort in C. (Consider the off-by-one gotcha at the end of the inner loop.) I know that strongly typed languages are unpopular on this forum and I've been downmodded for mentioning one. However, consider the suggested progression of languages to be like riding a bicycle and then having the training wheels removed.
I don't have direct experience of ML but I'd definitely recommend against Java because there's a tsumani of information. It is overwhelming for a newbie. Pascal is small and concise. The grammar is unambiguous. You know when you've outgrown it and you'll move on. When you master Pascal then C looks trivial. When you master C then Perl looks positively slack. This can be done while minimising information overload.