[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 8:28 AM
To: Palm Developer Forum
Subject: Re: DmFindRecordByID() working time...
> thanks.
> But I don't understand why it is O(n).
> Is it so difficult for PalmOS' developers (developers of DM module)
> to make it wor
> did you read my response?
>
> to be O(log n) you must have the records sorted by unique ID.
> and, i doubt the OS is going to re-arrange everything for you
> to make this possible.. dont you think?
Yes, but there are many other ways and algorithms to make it
work faster. (for example to store (
--- Robert McKenzie <[EMAIL PROTECTED]> wrote:
>
> The winds of change are a-blowing!
>
How many roads must a man walk down...
:)
(Apoligies for YAOTM.)
__
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remem
isting set-up.
But don't loose heart! The winds of change are a-blowing!
-bob mckenzie, palmsource pdx.
-Original Message-
From: Aaron Ardiri [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 8:28 AM
To: Palm Developer Forum
Subject: Re: DmFindRecordByID() working tim
> thanks.
> But I don't understand why it is O(n).
> Is it so difficult for PalmOS' developers (developers of DM module)
> to make it work like O(log n) ?
> I think this is a quite important question... :)
did you read my response?
to be O(log n) you must have the records sorted by unique ID.
a
thanks.
But I don't understand why it is O(n).
Is it so difficult for PalmOS' developers (developers of DM module)
to make it work like O(log n) ?
I think this is a quite important question... :)
Max.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http:
Max:
It is O(n). To be more precise, it is a simple linear search starting with record 0 &
incrementing through the db. In pseudo-code:
for (n=0; nmailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 7:53 AM
To: Palm Developer Forum
Subject: DmFindRecordByID() working time...
Hello!
> How does DmFindRecordByID() work?
> Does it use O(log n) search or it's just a O(n) ? :)
>
> for example:
> DmFindRecordByID( ... UInt16 *index, UInt32 ID, ... )
> {
> .
> for( i=0;i {
>
> if( record[i].uniqueID == ID ) { *index = i; break; }
>