Differentiate between array and list in scala.



Differentiate between array and list in scala...

Answer / Sunita Devi

"Scala Array is a fixed-size data structure, meaning its size is decided at the time of creation, whereas List is a variable-sized data structure, allowing elements to be added or removed dynamically. Array has constant-time access to any element, but modifying an array requires shifting all subsequent elements when adding or removing elements in the middle. On the other hand, Lists provide O(1) insertion and deletion at both ends, but accessing an element can take up to O(n) time."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Scala Interview Questions

What are the Scala variables?

1 Answers  


Please explain closure is scala?

1 Answers  


What is map in scala?

1 Answers  


What language is scala written in?

1 Answers  


What is a closure?

1 Answers  


What is 'Application' in Scala or What is Scala Application? What is 'App' in Scala? What is the use of Scala’s App?

1 Answers  


What is lambda expression in scala?

1 Answers  


What square measure the Scala variables?

1 Answers  


What do you understand by an implicit parameter in scala ?

1 Answers  


How many operators are there in Scala and Why?

1 Answers  


Make a case for ‘Scala higher order’ functions?

1 Answers  


List different types of literals available in scala?

1 Answers  


Categories