Click here to Skip to main content
15,887,881 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Need cut optimization algorith Pin
harold aptroot14-Sep-09 2:22
harold aptroot14-Sep-09 2:22 
GeneralRe: Need cut optimization algorith Pin
xx77abs14-Sep-09 2:40
xx77abs14-Sep-09 2:40 
GeneralRe: Need cut optimization algorith Pin
harold aptroot14-Sep-09 2:57
harold aptroot14-Sep-09 2:57 
GeneralRe: Need cut optimization algorith Pin
xx77abs14-Sep-09 3:21
xx77abs14-Sep-09 3:21 
GeneralRe: Need cut optimization algorith Pin
harold aptroot14-Sep-09 3:39
harold aptroot14-Sep-09 3:39 
AnswerRe: Need cut optimization algorith Pin
IdUnknown14-Sep-09 5:46
IdUnknown14-Sep-09 5:46 
GeneralRe: Need cut optimization algorith Pin
xx77abs14-Sep-09 6:50
xx77abs14-Sep-09 6:50 
QuestionSearch for repeated character combinations algorithm Pin
khalidelmeknesi9-Sep-09 2:31
khalidelmeknesi9-Sep-09 2:31 
Hi everybody,

I have an tool that reads an file. That file has for example the follow content:

wvtnfhxyz1hdxyz1fdxyz1ejxyz1dhxyz1dxyz1eeaa1oeys

I would like to search for repeated character combinations like the bold characters. The character combination xyz1 repeated 6 times.

I would like to return some top 5 with the most repeated character combinations. Something like this:

xyz1 : 6 times
aa5 : 5 times
ab4 : 3 times
ab : 2 times
66 : 2 times

This is the code that reads the file:

string path = @openFileDialog1.FileName;
                try
                {
                    // Open the stream and read it back.
                    using (FileStream fs = File.OpenRead(path))
                    {
                        byte[] b = new byte[1024];
                        //UTF8Encoding temp = new UTF8Encoding(true);
                        UTF7Encoding temp = new UTF7Encoding(true);

                        while (fs.Read(b, 0, b.Length) > 0)
                        {
                            textBox1.Text += temp.GetString(b);

                        }
                    }
                }



Thanks!
AnswerRe: Search for repeated character combinations algorithm Pin
Richard MacCutchan9-Sep-09 3:01
mveRichard MacCutchan9-Sep-09 3:01 
GeneralRe: Search for repeated character combinations algorithm Pin
khalidelmeknesi9-Sep-09 20:50
khalidelmeknesi9-Sep-09 20:50 
AnswerRe: Search for repeated character combinations algorithm Pin
Luc Pattyn9-Sep-09 12:23
sitebuilderLuc Pattyn9-Sep-09 12:23 
GeneralRe: Search for repeated character combinations algorithm Pin
khalidelmeknesi11-Sep-09 0:38
khalidelmeknesi11-Sep-09 0:38 
GeneralRe: Search for repeated character combinations algorithm Pin
Luc Pattyn11-Sep-09 1:14
sitebuilderLuc Pattyn11-Sep-09 1:14 
GeneralRe: Search for repeated character combinations algorithm [modified] Pin
khalidelmeknesi16-Sep-09 22:46
khalidelmeknesi16-Sep-09 22:46 
GeneralRe: Search for repeated character combinations algorithm Pin
Luc Pattyn17-Sep-09 2:05
sitebuilderLuc Pattyn17-Sep-09 2:05 
GeneralRe: Search for repeated character combinations algorithm Pin
khalidelmeknesi17-Sep-09 2:18
khalidelmeknesi17-Sep-09 2:18 
GeneralRe: Search for repeated character combinations algorithm Pin
Luc Pattyn17-Sep-09 3:31
sitebuilderLuc Pattyn17-Sep-09 3:31 
AnswerRe: Search for repeated character combinations algorithm [modified] Pin
Moreno Airoldi12-Sep-09 4:40
Moreno Airoldi12-Sep-09 4:40 
AnswerRe: Search for repeated character combinations algorithm Pin
Member 419459314-Sep-09 7:04
Member 419459314-Sep-09 7:04 
Question[Message Deleted] Pin
kabirbdboy8-Sep-09 23:35
kabirbdboy8-Sep-09 23:35 
AnswerRe: help me to select my project Pin
CPallini9-Sep-09 1:53
mveCPallini9-Sep-09 1:53 
AnswerRe: help me to select my project Pin
Richard MacCutchan9-Sep-09 3:02
mveRichard MacCutchan9-Sep-09 3:02 
General[Message Deleted] Pin
kabirbdboy9-Sep-09 15:25
kabirbdboy9-Sep-09 15:25 
GeneralRe: help me to select my project Pin
Tim Craig9-Sep-09 17:56
Tim Craig9-Sep-09 17:56 
GeneralRe: help me to select my project Pin
kabirbdboy10-Sep-09 1:38
kabirbdboy10-Sep-09 1:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.