Stacks Queues and other data structures.

  • Follow


Before anyone asks, no I didnt go back to school, so it's not homework...:-)

with what's available in the FCL and/or data structure coding practice  has
anyone compared creating the code for your own linked list, or stack, or
queue, and browsing through it as opposed to using say a TList object?  any
benckmarks done?  I'd like to know which method is fastest?

--
St�phane Richard
Senior Software and Technology Supervisor
http://www.totalweb-inc.com
For all your hosting and related needs


0
Reply Stephane 8/12/2003 1:17:34 AM

Stephane Richard wrote:
> 
> Before anyone asks, no I didnt go back to school, so it's not homework...:-)
> 
> with what's available in the FCL and/or data structure coding practice  has
> anyone compared creating the code for your own linked list, or stack, or
> queue, and browsing through it as opposed to using say a TList object?  any
> benckmarks done?  I'd like to know which method is fastest?

I have written a Hash unit (a hash is like an array except that you can
use Strings as indexes). I translated some parts of Perl's C-source
(version 5.6.1) to Pascal - so I think performance is not that bad. 
See http://www.behrenhoff.de/pascal/hash.zip

I'm sure I have used and wirtten Queues and Stacks but have never done
benchmarks.

Wolf

0
Reply Wolf 8/12/2003 9:50:16 AM


Wolf Behrenhoff wrote:
> Stephane Richard wrote:
> >
> > with what's available in the FCL and/or data structure coding
> > practice  has anyone compared creating the code for your own
> > linked list, or stack, or queue, and browsing through it as
> > opposed to using say a TList object?  any benckmarks done? 
> > I'd like to know which method is fastest?
> 
> I have written a Hash unit (a hash is like an array except that
> you can use Strings as indexes). I translated some parts of
> Perl's C-source (version 5.6.1) to Pascal - so I think
> performance is not that bad.
> See http://www.behrenhoff.de/pascal/hash.zip

I have made available a generic hashing library in C, which should
easily be translated to Pascal since it does not use realloc. 
See:

  <http://cbfalconer.home.att.net/download/>

and select hashlib.zip.

Porting to Pascal will require about 15 or so separate types
because new cannot use an arbitrary size (and still adhere to
standards).  This will be the major logical change from C to
Pascal.  Some extensions over ISO 7185 Pascal are needed to handle
saving function pointers.  Extended (ISO 10206) Pascal should be
very adequate.

Hash tables are not much like arrays.  They access items via a
key, in O(1), but the resemblance pretty well stops there.  The
various demo programs in hashlib.zip show how to access all items
sequentially, or in sorted order, etc.

-- 
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!


0
Reply CBFalconer 8/12/2003 9:44:13 PM

2 Replies
491 Views

(page loaded in 0.049 seconds)

Similiar Articles:













7/23/2012 6:07:37 PM


Reply: