logo

Crowdly

Browser

Add to Chrome

Який алгоритм пошуку рядків реалізовано у цьому коді? int Search_substrings(str...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Який алгоритм пошуку рядків реалізовано у цьому коді?

int

Search_substrings(string src, string sub)

{

    int

start

= 0;

    int

count

= 0;

    int

pos

= 0;

    for(;;)

     {

        pos = src.find(sub.c_str(),start);

        if (pos != -1){

            start = pos + sub.size();

            count++;

        } else

           break;

     }

    return count;

}

More questions like this

Want instant access to all verified answers on cyber.onua.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome