QUESTION 15 The following algorithm finds the same character in two strings: string, -xx2Xn and string2=y1y2-Yn How many times would Step 4.1.1. be performed for the following inputs: string = 6632176980 string, = 8703125409 1. input n 2. input the n-character long string x1x2X3 Xn 3. input the n-character long string yıY2y3 **Yn 4. for i = 1 ton do 4.1. for j = 1 to n do 4.1.1. if x, = y, then 4.1.1.1. return "A common character has been found; it is x," 5. return "There is no common character in the given two strings"

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 29PE
icon
Related questions
Question
QUESTION 15
The following algorithm finds the same character in two strings: string, =x,xX, and string2=yıy2-Yn How many times would Step
4.1.1. be performed for the following inputs:
string = 6632176980
string, = 8703125409
1. input n
2. input the n-character long string x1x2x3 Xn
3. input the n-character long string yıY2y3 **Yn
4. for i = 1 ton do
4.1. for j = 1 to n do
4.1.1. if x, = y, then
4.1.1.1. return "A common character has been found; it is x,"
5. return "There is no common character in the given two strings"
Transcribed Image Text:QUESTION 15 The following algorithm finds the same character in two strings: string, =x,xX, and string2=yıy2-Yn How many times would Step 4.1.1. be performed for the following inputs: string = 6632176980 string, = 8703125409 1. input n 2. input the n-character long string x1x2x3 Xn 3. input the n-character long string yıY2y3 **Yn 4. for i = 1 ton do 4.1. for j = 1 to n do 4.1.1. if x, = y, then 4.1.1.1. return "A common character has been found; it is x," 5. return "There is no common character in the given two strings"
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Time complexity
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning