Re: string parser
From: Victor Bazarov (v.Abazarov_at_comAcast.net)
Date: 08/18/04
- Next message: yaniv1234567890: "Link Error"
- Previous message: Richard Herring: "Re: Multiple union member initialization"
- In reply to: Raghavendra Mahuli: "string parser"
- Next in thread: Raghavendra Mahuli: "Re: string parser"
- Reply: Raghavendra Mahuli: "Re: string parser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 18 Aug 2004 09:32:02 -0400
Raghavendra Mahuli wrote:
> 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....
> For EX1:
> str1 - dfahaesdhfkj
> str2 - dfahaisds
> In str1, ae appears at position 4 and 5
> In str2, ai appears also at position 4 and 5....
>
> So they are equivalent.....And i can replace ae in str1 with ai......
>
>
> EX2:
> str3 - haehasdg
> str4 - hhsdaiskdn
> In str3, ae appears at position 1 and 2
> In str4, ai appears also at position 4 and 5....
> So here the rule "equivalent -values" does not apply......So i cant replace
> "ae" in str3 with "ai".......
>
>
> 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 ....
First of all, this is not a language problem. Next time please post to
comp.programming if you need some kind of algorithm. Here you only post
if you have a C++ language problem/question/issue/interesting solution.
Second of all, if you do replace every 'ae' in both strings with 'ai',
it will change nothing WRT positional matches. Just try it and see.
Victor
- Next message: yaniv1234567890: "Link Error"
- Previous message: Richard Herring: "Re: Multiple union member initialization"
- In reply to: Raghavendra Mahuli: "string parser"
- Next in thread: Raghavendra Mahuli: "Re: string parser"
- Reply: Raghavendra Mahuli: "Re: string parser"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|