1 the maximum contiguous subsequence sum algorithms in the


1. The maximum contiguous subsequence sum algorithms in the text do not give any indication of the actual sequence. Modify them so that they return in a single object the value of the maximum subsequence and the indices of the actual sequence.

2. a. Write a program to determine if a positive integer, N, is prime.

b. In terms of N, what is the worst-case running time of your program? (You should be able to do this inO(√N).)

c. Let equal the number of bits in the binary representation of N. What is the value of B?

d. In terms of B, what is the worst-case running time of your program?

e. Compare the running times to determine if a 20-bit number and a 40-bit number are prime.

f. Is it more reasonable to give the running time in terms of or B? Why?

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: 1 the maximum contiguous subsequence sum algorithms in the
Reference No:- TGS01274490

Expected delivery within 24 Hours