Re: Fast Sort Linked List Of Strings

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Thu, 6 Mar 2008 13:14:03 -0800, Lorin
<Lorin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Would someone point me at a snippet showing how to do a proper fast sort on a
linked list of strings? yes strings. and by proper i mean justified (or
whatever you would call it). i.e. 22 comes before 219
I think I can figure out out to create the linked list sorted, but not
sorting after the list is filled.
And it is too big to fill one list then sort fill another linked list.
32K items and yes, I need to hold it all in memory.
I currently have an array class to do this, but the linked list should be
faster for some operations - e.g. remove, insert into middle of list.

Have you considered the idea of keeping the string array, and just
swapping the pointers? Removing and inserting can be made much faster
by using CopyMemory, with no need for a linked list.

J.
Jeremiah D. Seitz
Omega Techware
http://www.omegatechware.net
.



Relevant Pages

  • Re: Copying Similar Data Structures
    ... Since all my strings are fixed-length, do I need the SAFEARRAY stuff? ... I tried using a straight CopyMemory call and it seemed to work great. ... When finished I have array of new structure to write back to disk. ... > WeekOKAs Boolean ...
    (microsoft.public.vb.general.discussion)
  • Re: Copying Similar Data Structures
    ... > Since all my strings are fixed-length, do I need the SAFEARRAY stuff? ... > I tried using a straight CopyMemory call and it seemed to work great. ... > When finished I have array of new structure to write back to disk. ... > Tim Rude ...
    (microsoft.public.vb.general.discussion)
  • Re: Handling fixed-length strings in Visual Basic.NET
    ... Fixed Length Strings are only available through a Compatibility ... by Our Friends in Redmond as a "crutch" so that VB [Proper] ... either fix the length of each data element in the Class instance ... before writing them to the physical file). ...
    (microsoft.public.dotnet.languages.vb)
  • Re: copymemory basic question
    ... except the subject includes strings too. ... about CopyMemory; you are implying I was talking about something else, ... > character set translation in calling this specific API. ... "Any" in the declare. ...
    (microsoft.public.vb.winapi)
  • Re: Visio 2003, Saving as EMF file, Bugg - Text is divided in smal
    ... concerned with printing the characters at the proper ... > emf records, i only see the parts of a strings. ... > that have many commas in them. ...
    (microsoft.public.win32.programmer.gdi)