Using big-o notation state the runtime for this algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM13582321

1) 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.

 

(a) Demonstrate (with diagrams like the ones I show in the live chats and in the Phase 5 PowerPoint Guide) how the search would go if you used:

 

  •  
    • A sequential search
    • A binary search

 

(b) State the runtime for each of the searches, in this example, and for general data sets of size n. (and how you reached this run time)

 

(c) Address the issue of the order of the data in binary searching.

 

2) 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. Show your work.

 

3) 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 n. Would you expect the general runtime to be O(n), O(n2), O(n3), or some other function of n? Explain.

 

Reference no: EM13582321

Questions Cloud

State the union and intersection of the 2 sets and the : part i demonstrate demorgans laws using a venn diagram. define 2 sets and a universal set within which the 2 sets
Assume that a firm with a 35 percent tax rate receives : a firm that owns the stock of another corporation does not have to pay taxes on the entire amount of dividends
Inventories represent a considerable investment for every : question 1an inventory management decision modelinventories represent a considerable investment for every organization
A determine the regression equation b what is the value of : frans convenience marts are located throughout a metropolitan area. fran the owner would like to expand into other
Using big-o notation state the runtime for this algorithm : 1 consider searching algorithms on the following array of datanbsp22 21 9 4 16 2 10 14 20 31 26 19 17 28 8
Conduct a test of hypothesis to determine whether either : question in a multiple regression equation two independent variables are considered and the sample size is 25. the
Compute the standard error of estimate about 95 of the : refer to the following anova
Similarly most other countries have not in the past : 1. in 1929 there were more than 25000 commercial banks in the u.s. today there are still approximately 7000 banks. in
Adam borrows 4500 at 12 percent annually compounded : 1. adam borrows 4500 at 12 percent annually compounded interest to be repaid in four equal annual installments. the

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Various search trees and numerous sorting techniques

This week we were introduced to various search trees and numerous sorting techniques. Taking into consideration what you have learned this week, discuss how you can help Bob with his problem.

  System analystis you are required to analyse the

you are required to analyse the effectiveness of the qantas online air ticketing system. to do this you are required to

  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.

  Create an idef1x entity relationships diagram

The Metropolitan Housing Agency is a non profit corporation that advocates the development and improvement of low income housing.

  Creating algorithm to implement function

Create an Algorithm to implement the given function and explain how the required task can be achieved in a step by step process.

  Test the database management system functionality

In a report that less than half of all companies validate the in their databases and test database management system's functionality. Explain your answer.

  Your employee delivered an algorithm for resolving a task

your employee delivered an algorithm for solving a task. you were told the running time is on3. you have a large amount

  How is a pert chart useful?

How is a Pert chart useful? How is a Gantt chart useful? What are the differences and similarities between both?

  Explain good algorithms to solve character pathfinding

You are working on the new computer game. One of implementation problems you are trying to solve is character pathfinding. What algorithms would be good to use and explain why?

  Explaining diffie-hellman public-key algorithm

Use the Diffie-Hellman public-key algorithm to exchange secret keys.

  Question 1a i what is a pointer illustrate with an

question 1a i what is a pointer? illustrate with an exampleii give two advantages of the use of pointers over arraysb i

  Program for stack by using dynamically allocated array

Write a C++ class which implements stack by using a dynamically allocated array. Initial size of particular stack must be determined when it is created.

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