[Coco] "C string searching question
John Kent
jekent at optusnet.com.au
Tue Oct 2 03:34:48 EDT 2012
If the records are ordered alphabetically based on the record name and
the search strings are sorted alphabetical you could do a sort of merge
search.
i.e. Once you match the first string you can work from that point in
each list to match the next string.
The near optimal sort is a Batcher sort although it's a trade off
between speed and memory space.
You can do a recursive successive approximation sort, or an insertion
sort if you are building the search list entry by entry.
You could use a linked list or double linked list, so you only have to
move the pointers rather than the whole record.
There is a Sort and Merge package for Flex9 for the 6809.
Google for sorting and searching algorithms.
John.
On 2/10/2012 3:22 PM, Bill Pierce wrote:
> This is why I was doing byte by byte search... find fist char, then match 2nd, ?no match? move to next char in string and start over. I had it working just doing first word search, then started editing the code to move through the string for any occurance and got it messed up. Now I can't seem to get it back to the working version... and by the way, it was pretty fast through almost 200 songs. I didn't try any higher counts yet.
>
> Bill P
>
> Music from the Tandy/Radio Shack Color Computer 2 & 3
> https://sites.google.com/site/dabarnstudio/
> Bill Pierce
> ooogalapasooo at aol.com
>
>
--
http://www.johnkent.com.au
http://members.optusnet.com.au/jekent
More information about the Coco
mailing list