Difference between Iterator and Stream in Scala?
scala
Solution
Stream memoises and Iterator does not. You can traverse the same Stream multiple times and get the same result each time. Iterator, on the other hand, can only be traversed once.
Problem
It seems that both Iterator and Stream are lazy and allow you to keep returning elements to your heart's content. What's the difference between the two?