TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Neil Heller
from: Jasen Betts
date: 2004-05-21 06:20:02
subject: A question

Hi Neil.

19-May-04 13:34:00, Neil Heller wrote to Pascal Schmidt


 NH> I tried my original method last night.  I didn't get very far,
 NH> considering that my real + virtual memories total less than the 4+
 NH> gigs required.  How does this sound:  do a QuickSort on the array
 NH> (after it's been determined to all fit easily into memory).

a radix sort would be better if you want O(n) badly enough.
I don't think radix can be done in-place AIUI it's better suited to liked
lists.

 NH> The question then becomes: how does one eliminate the holes once all
 NH> the duplicates are eliminated>

Do both at the same time...

run through the array copying one from each group of equal integers into
the start of the array.

int uniquify(int /* sorted */ array[],int num /* of entries */ );
  // returns number of unique entries
  {
  int i,u=0:
   for( i=1 ; i Bye <=-

---
* Origin: Don't pay your exorcist & get repossessed! (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.