finding the longest string with maximum repetitions from a file











up vote
-3
down vote

favorite












This is my question. And I am stuck. It'd be great if I could get some help.




Write a program to find the biggest string that appears maximum times in the DNA.txt (uploaded on moodle).



For example:
Consider the following sequence DNA_X :



DNA_X: acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt




In the above sequence, the string “acccgttac” is the string with the highest length (9) that appears maximum number of times. The highlighted string below has the maximum length with the highest number of occurrence.




acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt











share|improve this question




















  • 1




    The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
    – JiaHao Xu
    Nov 11 at 2:25












  • Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
    – hlg
    Nov 11 at 2:31






  • 1




    "It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
    – Sam Varshavchik
    Nov 11 at 2:32










  • @Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
    – JiaHao Xu
    Nov 11 at 2:33






  • 1




    Why isn't c the answer ?
    – Hiroki
    Nov 11 at 5:10















up vote
-3
down vote

favorite












This is my question. And I am stuck. It'd be great if I could get some help.




Write a program to find the biggest string that appears maximum times in the DNA.txt (uploaded on moodle).



For example:
Consider the following sequence DNA_X :



DNA_X: acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt




In the above sequence, the string “acccgttac” is the string with the highest length (9) that appears maximum number of times. The highlighted string below has the maximum length with the highest number of occurrence.




acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt











share|improve this question




















  • 1




    The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
    – JiaHao Xu
    Nov 11 at 2:25












  • Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
    – hlg
    Nov 11 at 2:31






  • 1




    "It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
    – Sam Varshavchik
    Nov 11 at 2:32










  • @Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
    – JiaHao Xu
    Nov 11 at 2:33






  • 1




    Why isn't c the answer ?
    – Hiroki
    Nov 11 at 5:10













up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











This is my question. And I am stuck. It'd be great if I could get some help.




Write a program to find the biggest string that appears maximum times in the DNA.txt (uploaded on moodle).



For example:
Consider the following sequence DNA_X :



DNA_X: acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt




In the above sequence, the string “acccgttac” is the string with the highest length (9) that appears maximum number of times. The highlighted string below has the maximum length with the highest number of occurrence.




acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt











share|improve this question















This is my question. And I am stuck. It'd be great if I could get some help.




Write a program to find the biggest string that appears maximum times in the DNA.txt (uploaded on moodle).



For example:
Consider the following sequence DNA_X :



DNA_X: acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt




In the above sequence, the string “acccgttac” is the string with the highest length (9) that appears maximum number of times. The highlighted string below has the maximum length with the highest number of occurrence.




acccgttacagctgacccgttacgtcaacccgttaccgatacccgttacagt








c++ data-structures linked-list tree






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 2:22









user1118321

19.2k43963




19.2k43963










asked Nov 11 at 2:16









Bishnu bro

1




1








  • 1




    The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
    – JiaHao Xu
    Nov 11 at 2:25












  • Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
    – hlg
    Nov 11 at 2:31






  • 1




    "It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
    – Sam Varshavchik
    Nov 11 at 2:32










  • @Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
    – JiaHao Xu
    Nov 11 at 2:33






  • 1




    Why isn't c the answer ?
    – Hiroki
    Nov 11 at 5:10














  • 1




    The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
    – JiaHao Xu
    Nov 11 at 2:25












  • Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
    – hlg
    Nov 11 at 2:31






  • 1




    "It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
    – Sam Varshavchik
    Nov 11 at 2:32










  • @Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
    – JiaHao Xu
    Nov 11 at 2:33






  • 1




    Why isn't c the answer ?
    – Hiroki
    Nov 11 at 5:10








1




1




The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
– JiaHao Xu
Nov 11 at 2:25






The problem is actually about finding the longest substring that repeats the most, the current topic is confusing.
– JiaHao Xu
Nov 11 at 2:25














Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
– hlg
Nov 11 at 2:31




Please clarify where you are stuck - that is: What have you tried already and where does your current solution fail? See stackoverflow.com/help/on-topic #3.
– hlg
Nov 11 at 2:31




1




1




"It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
– Sam Varshavchik
Nov 11 at 2:32




"It'd be great if I could get some help." -- unfortunately, stackoverflow.com is not a tutorial web site. This is a Q&A site, with concrete, specific questions on programming-related topics.
– Sam Varshavchik
Nov 11 at 2:32












@Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
– JiaHao Xu
Nov 11 at 2:33




@Bishnu bro There is an inconsistency in this question: If you want the highest repetition times, a single-character string probably repeats most.
– JiaHao Xu
Nov 11 at 2:33




1




1




Why isn't c the answer ?
– Hiroki
Nov 11 at 5:10




Why isn't c the answer ?
– Hiroki
Nov 11 at 5:10

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245277%2ffinding-the-longest-string-with-maximum-repetitions-from-a-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53245277%2ffinding-the-longest-string-with-maximum-repetitions-from-a-file%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Bressuire

Vorschmack

Quarantine