1

I am an intermediate C++ programmer who is getting into Objective-C. I'm starting out by reading some of Apple's tutorials.

Does Objective-C have a container type that is implemented as a Binary Search Tree or an AVL Tree? I'm just trying to get familiar with the different types of value objects and collection objects, and this question stood out to me.

Also any recommendations for good learning materials would be much appreciated.

dwesty17
  • 25
  • 6

1 Answers1

3

That's one of the situations where the Cocoa designers were a lot more practical than say C++: There is NSArray, there is NSDictionary, there is NSSet, but there are no implementation details. There is one class, and Apple makes it fast. There may be other classes that are hidden, but Apple will hide that from you. Seriously, why would you worry about a Binary Search Tree or AVL Tree (or hash table, much faster most of the time)?

There are classes with added functionality, like NSOrderedSet (mix of dictionary and array) and NSCountedSet (counting how often an element is added). There are no visible classes using different implementations, and nobody would want them.

gnasher729
  • 51,477
  • 5
  • 75
  • 98