Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i try to explain the basic steps of your algorithm using plain English Riddle (A) 11 Al1..n] is array of size n Problem 4 (15

image text in transcribed

i try to explain the basic steps of your algorithm using plain English Riddle (A) 11 Al1..n] is array of size n Problem 4 (15 points) 1 Set m0 (3 points) Let A be an array of n integers 2 Set i-j 1 which can be positive or negative. What does this algorithm do? Justify your answer. 4 Set t 0 while i sn 6 Set t-tA[jJ (3 points) Analyze its running time. 7 if tom . Set m t (9 points) Come up with a better algorithm if j-n for the same problem. For example, if the 10 original algorithm is O(n), then your | :1 algorithm must be better, like O(n2) or O(n),12 Increase i by 1 set j = i set t = 0 13 else Increase j by 1 14 returnm etc

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

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

Students also viewed these Databases questions