Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . ) Give the approximate running times of each of the following algo - rithms ( a . k . a . functions )

1.)
Give the approximate running times of each of the following algo-
rithms (a.k.a. functions) using -notation. Note that you can immediately drop
any floor or ceiling functions and that if you forget the "+1" in something like
k=a(n)b(n)C=C(b(n)-a(n)+1) it won't affect your answers. (If either summa-
tion limit contains a explicit number it is better to include it as it won't complicate
the work.)
(a) FUNCTION f1(n)
slarr0
FOR ilarrn TO|??n??32|DO
FOR jlarr5iTO2i2DO
,slarrs+i-j
RETURN(s)
(b) FUNCTION f2(n)
slarr0
FOR ilarr|??n5??|TOnDO
FOR jlarri TOnDO
slarrs+i-j
RETURN (s)
(c) FUNCTION f3(n)
slarr0
FOR ilarrn TO2n2DO
FOR jlarr5iTO5i+15DO
slarrs+i-j
RETURN (s)
(d) FUNCTION f4(n)
slarr0
FOR ilarr5nTO6n3DO
FOR jlarr5TOiDO
FOR klarrj TOiDO
slarrs+i-j
RETURN(s)
image text in transcribed

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

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions