Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Romaining Time: 58 minutes, 52 seconds. Question Completion Status: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

image text in transcribed
image text in transcribed
Romaining Time: 58 minutes, 52 seconds. Question Completion Status: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 QUESTION 8 Given two strings, each 50 characters long, what is the maximum possible number of times the for-do loop in steps 2 and 3 are executed? 1. Input strings .....and y ... n and s 2. For i = 1 to n do 2.1. If I, -then 2.1.1. Return "String one contains 8." 3. For i = 1 to n do 3.1. If -s then 3.1.1. Return "String two contains s." 4. Return "Neither string contains s." a) For-do loop in step 2 b) For-do loop in step 3 QUESTION 12 Given the following input determine the number of times the for-do loops in step 2 and step 3 are executed. (Input your answers as numbers.) string 1 = 738537858357 string2 = 429068321021 n=12 s=9 1. Input strings ....., and .....on and 2. For i = 1 to n do 2.1. If I, - then 2.1.1. Return "String one contains." 3. For i1 to n do 3.1. If then 3.1.1. Return "String two contains." 4. Return "Neither string contains s." a) For-do loop in step 2 b) For-do loop in step 3

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Algorithmic Trading Navigating The Digital Frontier

Authors: Alex Thompson

1st Edition

B0CHXR6CXX, 979-8223284987

Students also viewed these Databases questions

Question

Different formulas for mathematical core areas.

Answered: 1 week ago

Question

4. How is culture a contested site?

Answered: 1 week ago