VadaVaka
String Sorting Algorithm - Printable Version

+- VadaVaka (https://vadavaka.com/forums)
+-- Forum: General Forums (https://vadavaka.com/forums/forumdisplay.php?fid=5)
+--- Forum: IT-Geeks Hang Out (https://vadavaka.com/forums/forumdisplay.php?fid=42)
+---- Forum: Programming (https://vadavaka.com/forums/forumdisplay.php?fid=27)
+---- Thread: String Sorting Algorithm (/showthread.php?tid=4566)



String Sorting Algorithm - 8-up - 02-27-2006

I've been trying to write a string sorting algorithm for the past few days.

I'm using a lanugage that does not have any built-in functions that sort the way I want to sort.

The strings will contain alpha and numeric characters.

Here's an example of what I want to do:

Let's say we have a file with the following strings:

TEST, BELT, 40E, A1, A2, 1, 2,3, 4, 1A, 1D, 2D, 65A, 3D, 4D, 10D, 1E, 20D, 30D, 40D, 41D, 1D1


The user is able to choose a minimum and maximum.

For example, user enters
Min: 1D
Max: 40D

and it should pull the following:
1D, 2D, 3D, 4D, 10D, 20D, 30D, 40D

(in that order)


I'm guessing it would be similar to the StrCmpLogicalW function, but I would like it to not be case sensitive.

I would appreciate the help.


String Sorting Algorithm - 8-up - 02-28-2006

I figured it out!

Thanks.


String Sorting Algorithm - smartass - 03-01-2006

Glad i could help, i made a few sorting algorithms in programming class. I was going to talk to you about it the next time i saw you cause i was too lazy to type out what i was thinking at that point in time.:D


String Sorting Algorithm - 8-up - 03-01-2006

' Wrote:Glad i could help, i made a few sorting algorithms in programming class. I was going to talk to you about it the next time i saw you cause i was too lazy to type out what i was thinking at that point in time.:D

Well, i didn't really write a string sorting algorithm.
It only compares two strings and finds which is greater based on natural sorting.
It could be used to sort, which I can see us using it for that in the near future.


String Sorting Algorithm - smartass - 03-01-2006

Yup, thats what my suggestion was going to be actualy. Exactly how i did it.