Re: string parser

From: Till Crueger (TillFC_at_gmx.net)
Date: 08/18/04


Date: Wed, 18 Aug 2004 17:45:03 +0200

On Wed, 18 Aug 2004 16:15:36 +0530, Raghavendra Mahuli wrote:

> Hi,
> I have many strings. I have to sort them. But sorting is not according to
> ascii but according to a different format (which keeps varying) . So i can
> sort them based on sort-order. It is not much of a problem.
>
> But the complex part is "equivalent-values". it can be defined that "ai" and
> "ae" are equivalent-values. Then, while sorting two strings, i have to
> consider that "ai" and "ae" are equal......only if they come at same
> position in both the strings....
[snip]
> In short, the "equivalent-values" applies only when the
> "position-matches"...
>
> To add to that such equivalent values are many......
> So can you please suggest me some way of solving this problem ....

If you aren't very carefull how you obtain such equivalencies, then the
Problem is not solvable. For example with your equivalency rules above one
can determine that aia<aez of the substitution of ai and ae. However when
you compare afa to those strings you get afa<aia and aez<afa so you get:
afa<aia<aez<afa, which destroys all possibilities of ordering.
        Till

-- 
Please add "Salt and Peper" to the subject line to bypass my spam filter


Relevant Pages

  • Re: list view question
    ... > sort data other than strings and columns other than first column. ... > column to perform sorting on and then to do the sorting on that column ... > Public Sub New(ByVal aColumn As Integer, ByVal order As SortOrder, ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: list view question
    ... sorting columns in .net is not as simple as in VB. ... sort data other than strings and columns other than first column. ... exposes compare method to compare two objects. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • need an algo for string sorting
    ... I have to sort them. ... Then, while sorting two strings, i have to ... In str3, ae appears at position 1 and 2 ...
    (comp.programming)
  • string parser
    ... I have to sort them. ... Then, while sorting two strings, i have to ... In str3, ae appears at position 1 and 2 ...
    (comp.lang.cpp)
  • Re: Solution for sorting an array alpha-numerically
    ... strings up into groups and sorting the groups seperately, ... > so that numeric and alphabetic data sort as seperate groups. ... To the same project as the web page, add the class AlphaNumCompare() ...
    (microsoft.public.dotnet.general)