Create a table that depicts the runtime for arrays of length

Assignment Help Data Structure & Algorithms
Reference no: EM13943799

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, and the same algorithm on a data set of size 20 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: EM13943799

Questions Cloud

Petrol used for petrol engine contain : The petrol used for petrol engine contain, 84% carbon and 16% hydrogen. The air supplied is 80 % of that theoretically required for complete combustion. Assuming that all hydrogen is burnt, and that carbon burns partly to CO and par..
Determine the denavit-hartenberg parameters of this robot : Determine the A matrices of this robot. What is the position of the end effector with respect to the base of the robot in the specified configuration?
Explain why cornelius was able to report net cash flow : Explain why Cornelius was able to report net cash flow from operating activities that was higher than net income. Explain why this is important to financial statement users.
Number of men and women in the sample : In addition, is it a problem that the number of men and women in the sample is different? Why or why not? Note: This is a two sample test for proportion, please use the following guidelines
Create a table that depicts the runtime for arrays of length : 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.
Write a response to nato architecture framework : What's the message to the business? What are ways to attain early wins? Write a response to NATO Architecture Framework 200 words or less
Prepare the net cash flows from operating activities : Prepare the net cash flows from operating activities using the indirect method. What are the causes of the major differences between net income and net cash flow from operating activities?
Description of the steps of the algorithm and justify it : Design an algorithm that solves the above problem using a mandatory heap and has time complexity O(m + k*lg(m)) and space complexity O(m).
Calculate the export price and profit : Calculate the export price and profit in $. Market price is $240.00 (what customer pays); manufacturing cost is $60.00; freight is 10% (market price); customs duty is 5.4% (market price). Calculate the export price if the distribution chain is a)

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  What is the relationship of object model to data structure

What are the reasons for object orientation? What is the relationship of the object model to the data structure

  Yaou will now look at stacks and queues using linked lists

you will now look at stacks and queues using linked lists. complete the following for this assignment1 create a

  Construct the weight vector of the maximum margin hyperplane

Construct the weight vector of the maximum margin hyperplane by inspection and identify the support vectors - how many leaf nodes can a decision tree have if it is consistent with a training set containing 100 examples?

  Find terminal nodes in tree nil if pointer is represented

The node's right child. If the nil pointer is represented by 00 and the tree's root pointer contains 53, how many terminal nodes are in tree?

  The time delay of a long-distance

The time delay of a long-distance call can be determined by multiplying a small fixed constant by the number of communication links on the telephone network between the caller and callee.

  Portfolio website containing thumbnail imagery

Explain in general terms what you think the role of good design is. Next, recognize 3-characteristics of an effective gallery website. Then find an example of a portfolio website containing thumbnail imagery.

  Water resources engineering

The current practice of a particular part of water resources engineering is supported through a variety of commercial software. Pick a specific domain within water resources engineering.

  A sparse matrix is a matrix populated primarily with zeros

a sparse matrix is a matrix populated primarily with zeros. nbspclassical matrix multiplication is too inefficient for

  Is an array that is in reverse sorted order a heap

What is the expectation of the index of the maximum element in the array and expectation of the index of the minimum element in the array?

  Pseudocode for divide-and-conquer algorithm

Write a pseudocode for a divide-and-conquer algorithm for finding the position of the largest element in an array of n numbers.

  What are entity-relationship diagrams

What are entity-relationship diagrams, and how are they used? Discuss the ethical issues to consider when planning a database.

  Task 0111 write down the pseudo code for merge sort

task 011.1 write down the pseudo code for merge sort algorithm and using bellow array values perform the merge sort

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