質問

What is the complexity for Seq.append? Is it O(1) time and space?

I might add that (a) I should certainly hope so, and (b) I failed to google my way to complexity bounds for Seq module members. If someone know of such, I'd love to have a link to it.

EDIT. I did check the source code before asking. The implementation is here, which will make you look, eventually, at this function, the implementation of which is not immediately accessible to me, and the comments before which puzzles me.

役に立ちましたか?

解決

Yes, it is O(1) because it basically just create a new object that encapsulates the two original sequences.

See source code here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top