• 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: Dificult question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dificult question.


  • Subject: Re: Dificult question.
  • From: Hasan Diwan <email@hidden>
  • Date: Sun, 21 Jul 2002 01:45:56 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aidas:
What sort of search algorithm did you use? If it was a linear search, you may want to try a binary search, which assuming your data stays sorted, will be a lot faster (graph f(x)=x/2 vs. f(x)=ln(x)/ln(2) for a comparison of average runtime).
The binary search assumes your dataset is sorted, and so after every round, a half of your list can be discarded as not containing the data. This continues until your target is found. If you need sample code, contact me off-list.
On Saturday, July 20, 2002, at 08:21 PM, Aidas wrote:
I've tried to do a search for NSTableView(actualy I searched it's
datasource). My datasource has about 10000-20000 thousands records sorted
alphabeticaly. My search was working terible. It was so slow. Anyone has
expirience in doing fast search or has some ideas?
Hasan Diwan
OpenPGP KeyID: 0xBE42DCA6
Fingerprint: 1CB0 47E3 0A24 DAC1 DCCA 4225 F166 40C2 BE42 DCA6
http://hasandiwan.net/~hdiwan/gpg.key
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iD8DBQE9Okqe8WZAwr5C3KYRAi+pAKCBhY6SG6EUDTpwBX79zQosAhTpZQCfcZ26
qPcUPCYI2zeEcWvRBsNsitU=
=Nn8W
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Dificult question. (From: Aidas <email@hidden>)

  • Prev by Date: Re: Trying to print an nsimage... What am I doing wrong?
  • Next by Date: Re: reading a plist
  • Previous by thread: Dificult question.
  • Next by thread: Integrate AppleScript into project?
  • Index(es):
    • Date
    • Thread