Re: Check for Common character sequence ( I will pay)?



Homework?


"C" <C@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:43D5A724-542B-49C0-8B22-72CEE887F86F@xxxxxxxxxxxxxxxx
Hi,

Anyone know how I can do this?

I will pay anyone via PayPal who can do this for me. Let me know?

Write a function in C# that takes in an array of ASCII strings and finds
all
common character sequences. A common character sequence is defined as 3
or
more adjacent characters that appear in more than one string in the array.
Use the following function signature for your response:



//C#

class FoundString {

public int cOccurrences; //count of times this substring


//occurred in the value array
public string szSubstring; //substring that was found

}



FoundString[] countSubstrings(string[] rgszValues);



Ex. input of ("will-01", "a_williams", "will_01_iam") would return

"wil" (cOccurrences = 3)

"will" (cOccurrences = 3)

"ill" (cOccurrences = 3)

"iam" (cOccurrences = 2)



Provide coded unit tests cases that exercise your solution.



For extra credit:

1a. Order the results in descending order based on the number of input
values each sequence matched.

1b. Prune the results by removing all results that are a substring of
another result that matched the same number of input values. In the above
example "wil" and "ill" would both be discarded because they are both a
substring of "will" and all 3 values match 3 input strings




.



Relevant Pages

  • Re: Check for Common character sequence ( I will pay)?
    ... I will pay anyone via PayPal who can do this for me. ... common character sequences. ... //count of times this substring ... substring of "will" and all 3 values match 3 input strings ...
    (microsoft.public.dotnet.framework)
  • Re: Check for Common character sequence ( I will pay)?
    ... I will pay anyone via PayPal who can do this for me. ... Write a function in C# that takes in an array of ASCII strings and finds ... common character sequences. ... //count of times this substring ...
    (microsoft.public.dotnet.framework)
  • Re: Tough interview question - any suggestions?
    ... Write an efficient algorithm to find all the repeating substring with a ... Lexically sort the array. ... simplifies the string comparisons as well as reducing the memory usage. ... one pass might do all strings ...
    (comp.programming)
  • Re: searching data for a large set of substrings
    ... > that is given to me as a char * array. ... but let's treat them as strings) ... > This is a fairly mundane task, ... The substring "string", occurs 4 times. ...
    (comp.lang.c)
  • Re: K&R2 Secition 5.9 - major blunders
    ... Each element of b doesn't point to a 20 element array of int. ... This mistake is crucial because ... my explanation is really the qualities of something else: ... > The use of the array of pointers is to store the strings. ...
    (comp.lang.c)