scala - How does usage of Seq compare to that of List, Array and Vector? -


So, I have seen questions that compare, and I do not understand one thing. When should I really use a Seq on any of these? I understand when a list should be used when using array and when vector is used, but any of the above listed When is it a good idea to use Seq instead of collection? Why should use attribute which should expand ineligible instead of all the concrete sections listed above?

You should usually use the method or class as input parameters, in general the sequences Defined for (only normal, not normally required):

  def mySort [T] (CEC: sec [T]) = ... case class cover [T] (CEC: sec [T]) Built-in class Richec [T] (CEC: sec [T]) {DIF MySTort = ...}  

So now you can call any mySort Also in the order (like vector or list ) Can pass.

If you care about your algorithm about complexity - you can call it indexed SEK (Quick Random Element Access) or LinearSeq (for fast memory allocation) Can compact. Anyway, if you want your function to be higher on its input parameters, because Seq is a common interface for all the views, then you should prefer the top-level class. If you need more general - you can use traversal or renewable .


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -