Darren's Nuggets 090216

2009/01/19 Version »
bin zhou

Darren's Nugget
2009 / 02/ 16
Sorting arrays of clusters ...
More information :
GSDzone.net/community
It can also sort a 
1D Array of Clusters
the       element of the cluster (based on the cluster order) is used for the sort...
first
VS
for clusters where the first element has the same value, the second element of the cluster is used, etc
It can be used in sorting Array of String...
Usually, you want to sort string arrays without worrying about the strings being uppercase/lowercase.  Unfortunately, the ASCII values of the strings are used when sorting, so a simple sort would result in the following:
So the technique I use is to sort an array of clusters of two elements...the first element is an all lowercase version of the string, and the second element is the original string.  After the array is sorted, I then          the second element from each cluster to generate an array of sorted strings
unbundle
Try It ... 

Loading comments...

Please log in to add your comment.

Report abuse

More presentations by bin zhou

More prezis by author