Feb 7, 2009 (an Objective-C era article)
If you have a collection of interconnected objects in Objective-C, what is the best way to traverse them all in order from nearest to furthest? Are the NSMutableSet
methods good for tracking already-visited nodes? How much overhead does an NSMutableArray
FIFO queue impose relative to a depth-first search (which doesn't require a FIFO queue)? Does NSMutableArray
perform better if objects are pushed onto the front, or the back? In this post, I present answers to these questions and more.