comp.lang.ada
 help / color / mirror / Atom feed
From: z007400b@bc.seflin.org (Ralph Silverman)
Subject: Re: HELP ! need to insert value in array !!
Date: 1997/06/27
Date: 1997-06-27T00:00:00+00:00	[thread overview]
Message-ID: <5p0v7l$9uc@nntp.seflin.org> (raw)
In-Reply-To: 866920621snz@genesis.demon.co.uk


Lawrence Kirby (fred@genesis.demon.co.uk) wrote:
: In article <5oci49$97g@crl.crl.com> bobfry@crl.crl.com "Robert Fry" writes:

: >Lars <larsiver@post4.tele.dk> writes:
: ...
: >>This works - but is too slow when we are talking about lets say 5000
: >>positions to move...In the "delete" function i use memcopy/memmove and
: >>this appear faster - but offcourse theese functions doesnt work the
: >>other direction...

: memcpy() isn't defined to work at all for overlapping copies, memmove()
: works fine, whether copying backwards or forwards.

: >>Do i have to live with this ? or is there any faster way to push this
: >>array one pos foreward ??

: If you want to stick with arrays you'll have to live with it, insertion
: is simply an inefficient operation on an array. To do better you'll have
: to use a different type of datastructure.

: >Most people I know would use memmove (or memcpy -- I never remember which 
: >one is able to check for conflicts and handle this case). However, I'm 
: >not certain it's portable to all systems.

: Yes, it is.

: >If there's padding between 
: >array elements, you have some potential for problems with memmove.

: An impelemenattion is not permitted to pad between array elements.

: -- 
: -----------------------------------------
: Lawrence Kirby | fred@genesis.demon.co.uk
: Wilts, England | 70734.126@compuserve.com
: -----------------------------------------

	classic theory of sorting
	divide algorithms into two
	related types,
	a)
		primary
		leaf
		internal
	b)	external
		secondary
		etc.

	sorts here discussed are
		primary,  leaf,  internal
	...

	use of
		block move
	instruction(s) in 
		primary sort
	coupled with
	simple ( array )
	data-structure(s)
	is an effective method ...
	and provides very fast
	results ... ( on modern systems )
	...
	( e.g.  pc s manufactured >1989
	  generally incorporate very
	  effective dma ... )

	classic
		computation
	and
		algorithm theory
	generally rest on a
		vonneumann model
	whereby memory transactions
	'shuffle' through cpu ...
	modern methods allow dispacing
	such to 'intelligent' memory
	subsystem ... which acts similarly
	as a peripheral ...
	therefore actual system design
	allows algorithms which might seem
	very inefficient
	( by classic model )
	to be renovated into algorithms
	which are very effective !

--

Ralph Silverman
z007400b@bcfreenet.seflin.lib.fl.us





       reply	other threads:[~1997-06-27  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <33A9C27C.22F7@post4.tele.dk>
     [not found] ` <5oci49$97g@crl.crl.com>
     [not found]   ` <866920621snz@genesis.demon.co.uk>
1997-06-27  0:00     ` Ralph Silverman [this message]
1997-06-28  0:00       ` HELP ! need to insert value in array !! Lawrence Kirby
     [not found]       ` <dewar.867554609@merv>
1997-06-29  0:00         ` Mike Rubenstein
1997-06-29  0:00           ` Robert Dewar
1997-06-29  0:00             ` Mike Rubenstein
1997-06-29  0:00               ` Robert Dewar
1997-06-29  0:00                 ` Mike Rubenstein
1997-06-30  0:00                 ` Ed Hook
1997-07-04  0:00                 ` Richard A. O'Keefe
1997-07-07  0:00                   ` Clive D.W. Feather
1997-07-01  0:00               ` Al Bowers
1997-07-01  0:00             ` Richard Kenner
1997-07-01  0:00               ` Robert Dewar
1997-07-02  0:00             ` Christian Froeschlin
1997-07-02  0:00               ` Robert Dewar
1997-07-04  0:00             ` Richard A. O'Keefe
1997-07-04  0:00               ` Robert Dewar
1997-07-04  0:00                 ` Mike Rubenstein
1997-07-05  0:00                   ` Robert Dewar
1997-07-05  0:00                     ` Larry Kilgallen
1997-07-05  0:00                     ` Mike Rubenstein
1997-07-05  0:00                       ` Mike Rubenstein
1997-07-10  0:00                     ` Alan Bowler
1997-07-07  0:00                 ` Shmuel (Seymour J.) Metz
1997-07-07  0:00                 ` Mark H. Wood
1997-07-09  0:00                   ` Robert Dewar
1997-07-10  0:00                     ` Lawrence Kirby
1997-07-08  0:00                 ` Richard Kenner
1997-06-30  0:00         ` Samuel T. Harris
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox