QUESTION 13 What is the time complexity function of the following algorithm? 1. Input strings ... and y... n and s 2. For 1 ton do 2.1. If zs then 2.1.1. Return "String one contains s." 3. For i 1 ton do 3.1. If ys then 3.1.1. Return "String two contains s." 4. Return "Neither string contains s." af(n) =n b. n²-n f(n) = 2 Ocf(n)=2n d.f(n) =n² QUESTION 14 What is the time complexity function of the following algorithm? 1. Input string ..... In. 2. For i 1 ton-1 do 2.1 For j=i+1 ton do 2.1.1 If = then 2.1.1.1 Return "There is duplicate integer in the string." 3. Return "There are no duplicate integers in the string." a. f(n) = 2n b. n²-n f(n) = 2 f(n) =n² d.f(n) =n

Algebra & Trigonometry with Analytic Geometry
13th Edition
ISBN:9781133382119
Author:Swokowski
Publisher:Swokowski
Chapter5: Inverse, Exponential, And Logarithmic Functions
Section5.2: Exponential Functions
Problem 71E
icon
Related questions
Question
QUESTION 13
What is the time complexity function of the following algorithm?
1. Input strings ... and y... n and s
2. For 1 ton do
2.1. If zs then
2.1.1. Return "String one contains s."
3. For i 1 ton do
3.1. If ys then
3.1.1. Return "String two contains s."
4. Return "Neither string contains s."
af(n) =n
b.
n²-n
f(n) =
2
Ocf(n)=2n
d.f(n) =n²
QUESTION 14
What is the time complexity function of the following algorithm?
1. Input string
..... In.
2. For i 1 ton-1 do
2.1 For j=i+1 ton do
2.1.1 If = then
2.1.1.1 Return "There is duplicate integer in the string."
3. Return "There are no duplicate integers in the string."
a. f(n) = 2n
b.
n²-n
f(n) =
2
f(n) =n²
d.f(n) =n
Transcribed Image Text:QUESTION 13 What is the time complexity function of the following algorithm? 1. Input strings ... and y... n and s 2. For 1 ton do 2.1. If zs then 2.1.1. Return "String one contains s." 3. For i 1 ton do 3.1. If ys then 3.1.1. Return "String two contains s." 4. Return "Neither string contains s." af(n) =n b. n²-n f(n) = 2 Ocf(n)=2n d.f(n) =n² QUESTION 14 What is the time complexity function of the following algorithm? 1. Input string ..... In. 2. For i 1 ton-1 do 2.1 For j=i+1 ton do 2.1.1 If = then 2.1.1.1 Return "There is duplicate integer in the string." 3. Return "There are no duplicate integers in the string." a. f(n) = 2n b. n²-n f(n) = 2 f(n) =n² d.f(n) =n
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Algebra & Trigonometry with Analytic Geometry
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Linear Algebra: A Modern Introduction
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra: Structure And Method, Book 1
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell