I'm thinking about application which will find some repeated patterns on stored IEnumerable. What I found till now was finding given subsequences in sequence - what is rather easy.
What I think I need is way to:
- find if there is any unknown subseqence which ocurres more than once (note how does it look like, and where is placed)
- find unknown sub-subseqences of subsequence recursive until the length of found pattern is longer that 4 (ie)
For now I have two ideas to investigate more but I'm sure that there is ready algorithm which handle such problem.
Ideas
- Make
Dictionary<List<MyObject>, List <List<MyObject>> >
where I will keep as key first occurence of MyObject and then List of following occurences with expanding the list with each iteration. And then do the recursive finding for any found patterns. - Implement Hoffman coding because I think it belongs somehow to this problem.