I'm trying to translate a radix sort algorithm from Java to Haskell, and I'm really new to Haskell. I've been reading tutorials, but they are so lengthy and I'm trying to get my hands dirty now.
I'll be passing a list of lists to the sort algorithm, and my questions are:
- How would I traverse all elements in a list?
- How would I access a particular element within a list?
So for instance, I'd need to traverse over every list I have, and access particular elements by index (?) in that particular list. How!?
O(n), instead of O(1). If you started with an array in Java then I suggest you use a Vector or Array in Haskell, not a list. OTOH, if this really is homework then the instructor probably does want you using lists.