Beginner Swift
Q29 / 100

What is the difference between Array and ContiguousArray in Swift?

Correct! Well done.

Incorrect.

The correct answer is B) ContiguousArray always stores elements in a contiguous memory block; Array may bridge to NSArray for class types

B

Correct Answer

ContiguousArray always stores elements in a contiguous memory block; Array may bridge to NSArray for class types

Explanation

For performance-critical code with class or protocol types, ContiguousArray avoids NSArray bridging overhead by guaranteeing contiguous storage.

Progress
29/100