Object the value of the maximum subsequence

Assignment Help Basic Computer Science
Reference no: EM13968055

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?

Reference no: EM13968055

Questions Cloud

State an existence theorem for the differential equation : State an existence theorem for the differential equation - Find y0, y1, y2 after converting it to an integral equation
Number of multiplications used by the fast exponentiation : Give a precise count on the number of multiplications used by the fast exponentiation routine. (Hint: Consider the binary representation of N.)
What are the major sources of revenue : State and local governments are accountable to much more than private investors. They are accountable to the community as a whole.
Create a guide to leveraging expatriates : Create a guide to leveraging expatriates. The guide should include four to six sources that address benefits and challenges of sending expatriates to other countries.
Object the value of the maximum subsequence : 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.
Calculate the marginal after-tax winnings : Calculate the marginal after-tax winnings - find that jackpot size (to the nearest dollar) and explain what is significant (in terms of winnings) about that jackpot size.
Minimum positive subsequence sum : 1. Give ef?cient algorithms (along with running time analyses) to a. Find the minimum subsequence sum. b. Find the minimum positive subsequence sum.
Determining the input size : An algorithm takes 0.5 ms for input size 100. How long will it take for input size 500 if the running time is the following (assume low-order terms are negligible)?
Determine the mesh current i1 : Consider the circuit shown in the figure below. Suppose that R1 = 6Ω , R2 = 13Ω and R3 = 17Ω. Determine the mesh current i1. Express your answer to three significant figures and include the appropriate units.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Function creates and returns 1d list of final prices

Write a functon def final_price_list(inventory, row, col) that has 3 parameters - 2D list described above, number of rows and number of columns. Function creates and returns 1D list of final prices for all items after discount is applied. Assume t..

  Virtual and physical addresses

The page table shown in Figure 9.32 is for a system with 16-bit virtual and physical addresses and with 4,096-byte pages. The reference bit is set to 1 when the page has been referenced. Periodically, a thread zeroes out all values of the reference b..

  What is a constructor

What is a constructor? Give its properties. How do we declare/ define it? Can they be overloaded?

  Transport and tunnel modes in ipsec

Distinguish between transport and tunnel modes in IPSec. What are the strengths and weakness of each?

  Saas and cloud computing

SaaS and Cloud Computing

  Lists and arrays can be valuable tools

Lists and arrays can be valuable tools

  Focus on paramtized queries and stored procedure

The testing phase will include creating a simple page of login as password with simple code and show that the sql injections occurs (show codes and snapshots where necessary)

  Start by identifying all the hazards and potential causes

Start by identifying all the hazards and potential causes of harm to the IT infrastructure and functionality (for example, what are you going to do if the VIU main web site goes down, or what happens if viruses get into VIU computer systems, or..

  Describe steps improving or maintaining relations with other

Describe the steps necessary for improving and maintaining relations with other business units

  Websites for open source databases

Review the following websites for open source databases, such as PostgreSQL and MySQL Identify the open source databases back-up and recovery strategies Address the major differences in database back-ups and recovery between open source databases and..

  You are a junior staff member assigned to the chief

you are a junior staff member assigned to the chief information security officers ciso team in a major medical

  Explain the role of banks on the money supply

1)a )Explain the role of banks on the money supply. What is money multiplier? Explain.b) If the Central Bank increases the required reserve ratio what will happen to interest rate? Using appropriate diagram, show equilibrium in the money market.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd