What is the initial capacity of Set | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is the initial capacity of Set

What is the initial capacity of Set?

7th Oct 2017, 6:47 AM
Adarsh Srivastava
Adarsh Srivastava - avatar
1 Resposta
0
Great question. The Set Collection in Swift has many initialisers, some of which include init(), init(minimumCapacity:). When you call the empty initialiser the initial capacity is 0, however if you expect to have multiple values in your set, youā€™re better of using the minimumCapacity initialiser.
12th Jun 2021, 1:42 PM
Pawel Zabinski
Pawel Zabinski - avatar