• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSArray lookup, pointer comparison
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArray lookup, pointer comparison


  • Subject: Re: NSArray lookup, pointer comparison
  • From: Uli Kusterer <email@hidden>
  • Date: Tue, 29 May 2007 23:32:42 +0200

On 29.05.2007, at 19:51, Keith Duncan wrote:
I'm iterating over a tree of objects but instead of iterating the tree multiple times I decided to iterate the tree once and put the nodes into an array. This allows me to check for the presence of various objects quickly, for the purposes of this discussion two objects are deemed to be equal if a pointer comparison is true.

What kind of a tree is this? Sorted trees (like binary trees, or red/ black trees or whatever) have much better performance than the typical linear array search, because due to the sorting a well- balanced tree can eliminate half the nodes each time it decides which of two branches to go down. So, it might help to eliminate the array depending on your kind of tree.


If it's a file system, that might not be an option, of course, just checking...

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSArray lookup, pointer comparison (From: Keith Duncan <email@hidden>)

  • Prev by Date: Pasteboard issue
  • Next by Date: Re: How to draw a rectangle around a (graph) view?
  • Previous by thread: Re: NSArray lookup, pointer comparison
  • Next by thread: Disabling items in NSTabView
  • Index(es):
    • Date
    • Thread