+ 3

Can you write a program to detect a sequence in an array in C Lang.?

Program to detect a sequence in c, even if you know how to do it for strings, please share I think recursion in for loop having j variable make a move I'm trying to compare each value of sequence sub[] with arr[] and print something when the sequence is successfully traversed within the main array arr[] Can you help me how to proceed? My attempt: https://code.sololearn.com/cujqfQhgk9fG/?ref=app

12th May 2020, 10:00 AM
Tom
Tom - avatar
7 ответов
+ 2
Sandeep Kushwaha Thank you, Good Idea!
14th May 2020, 8:39 AM
Tom
Tom - avatar
+ 1
We can *assist* you with your task. Can you show us your attempt?
12th May 2020, 10:05 AM
HonFu
HonFu - avatar
+ 1
HonFu I'm stuck with the code here code.sololearn.com/cujqfQhgk9fG/#c I think recursion in for loop having j variable make a move I'm trying to compare each value of sequence sub[] with arr[] and print something when the sequence is successfully traversed within the main array arr[] Can you help me how to proceed?
12th May 2020, 10:42 AM
Tom
Tom - avatar
+ 1
Sandeep Kushwaha Sharda patel can you help me with this
12th May 2020, 10:43 AM
Tom
Tom - avatar
+ 1
Sandeep Kushwaha, I'm trying to detect a sequence if any in the string Sub[] is sequence to be detected and are[] is original input and comparing each element of sub[] with each element of are[] is my approach but I couldn't successfully justify the approach Even if you know any other approach please share it😇
14th May 2020, 1:39 AM
Tom
Tom - avatar