Create a table that depicts the runtime for arrays

Assignment Help Data Structure & Algorithms
Reference no: EM131132058

Algorithm Analysis

Consider searching algorithms on the following array of data:

[22 21 9 4 16 2 10 14 20 31 26 19 17 28 8 13]

Suppose you want to implement a searching algorithm to see if the data set contains the number 19. Demonstrate how the search would go if you used:

- A sequential search

- A binary search

State the runtime for each of the searches, in this example, and for general data sets of size n.Address the issue of the order of the data in binary searching.

Suppose an algorithm that processes a data set of size 8 has a runtime of 72. The same algorithm has a runtime of 110 when applied to a data set of size 10; and when applied to a data set of size 20, it has a runtime of 420. Using big-O notation, state the runtime for this algorithm for the general case of a data set of size n.

Suppose you develop an algorithm that processes the first element of an array (length of n), then processes the first 2 elements, then the first 3 elements, and so on, until the last iteration of a loop, when it processes all elements. Thus, if n = 4, the runtime would be 1 + 2 + 3 + 4 = 10.

Create a table that depicts the runtime for arrays of length 1 to 10. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain.

Reference no: EM131132058

Questions Cloud

Devise a breeding plan : Is it possible to devise a breeding plan that will result in that characteristic becoming universal among each subsequent generation?
What factors would contribute to the continue don : What factors would contribute to the continue don of the boom in commercial paper? What factors would cause a contraction in the commercial paper market?
Describe a different sdlc model : The paper will be five pages: (a) Describe the 7 Step SDLC - 2 pages, (b) Describe a different SDLC Model (4 step or 12 step) - 2 pages, (c) Compare and contrast the 7 Step Model and the second model you selected.
How might lenders use safes tax information to verify portio : How might lenders use safes tax information to verify portions of the financial statements?
Create a table that depicts the runtime for arrays : Create a table that depicts the runtime for arrays of length 1 to 10. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain.
Calculate probability that both transistors are defective : Box 1 contains 1000 transistors, of which 100 are defective, and box 2 contains 2000 transistors, of which 100 are also defective. A box is taken at random and two transistors are drawn from it, at random and without replacement.
How should hr advise the ceo in this situation : Analyze a successful business partnership, indicating which of the four factors were present. Analyze a failed business partnership, indicating which of the four factors were absent. Is it possible for a business partnership to succeed when none of t..
Develop a physical plan for data organization and retrieval : Develop a physical plan for data organization, storage, updating, and retrieval. How data will be output from the system? How data will be input to the system?
Estimate the impact campus crime : Using the information in Table 1, would you prefer to use Model 1 or Model 3 to estimate the impact campus crime has on new student enrollment?  What evidence is there to support your answer

Reviews

Write a Review

 

Data Structure & Algorithms Questions & Answers

  Create an array dynamically

Write a program to accept a number representing how many first names the user will enter from the command line (5 names maximum), and the actual first names, from the command line.

  A multinational tour operator agency has gained new

a multinational tour operator agency has gained new business growth in the north american market through the use of

  Write an algorithm that displays the squares of the number

Using a FOR loop,I need to write an algorithm that displays the squares of the number 1 to 10to console out put

  Determine the transmission rate

Assume two TCP connections are available over some bottleneck link of rate R bps. Both connections have a huge document to send in the similar direction over the bottleneck link

  Multiple choice - high school excel 2003

Cell E23 has a date value and you want to place that date on an invoice prefaced with the text located in B15. Determine the command to do that?

  Find the minimum cost path from a designated node

Find the Minimum Cost Path from a designated start node to a designated destination node in a graph.

  Computing minimal length of key-average cracking time given

If Encrypt-It-Rite would like to increase average cracking time to at least 100 years, determine the minimal length of the key?

  Data array a has data series from 1000000 to 1 with step

data array a has data series from 1000000 to 1 with step size 1 which is in perfect decreasing order.data array b has

  Find the kth largest value in an unsorted array of n element

find the kth largest value in an unsorted array of N elements. Estimate the running time. It should be better than quick sort running time.

  Develop a simple prototype version of the given algorithm

Before attempting this implementation, you choose to develop a simple prototype version of this algorithm in C++. Specifically, you will build an in-place, order reversal algorithm.

  Define the three types of shortest path problems

Why did Binomial heaps NOT require the mark bits and the rules about losing two children - Determine whether it is possible to draw a circle centered at the origin containing two or more of the points on its boundary.

  What will be the ouput of lines

Consider the following code snippet: 1. list = [ [ ] ] * 5 2. list # output? 3. list[0].append(110) 4. list # output? 5. list[1].append(200) 6. list # output? 7. list.append(230) 8. list # output? What will be the ouput of lines 2, 4, 6, and 8?

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