Demonstrate how this search would go

Assignment Help Computer Engineering
Reference no: EM1327708

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: EM1327708

Questions Cloud

Calculating present values of cash flows : You can purchase property today for $3.3 million and sell it in 5 years for $4.3 million. (You earn no rental income on the property.)
Bureaucratic costs increase : Given an example of how and why do bureaucratic costs increase a company goes.
Essay-environmental factors impact managers and leaders : The topic for the assignment is to discuss - How do environmental factors impact managers and leaders of organizations?
Show the impact of new technology on customers : Show the Impact of new technology on customers - end users or outside customers. Must be about a specific technology for a specific company.
Demonstrate how this search would go : assume 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 runtime for this algorithm for the general case of a data set of size n.
Explain important information about e business : Explain Important information about E Business and difference between Internet, Intranet and Extranet
Present and future values with varying interest rates : If the interest rate this year is 7.2% and the interest rate next year will be 9.2%, what is future value of $1 after 2 years? What is present value of a payment of $1 to be received in 2 years?
Explain project management in the business world : Project management in the business world - describe project management and explain its importance to the business world and describe project life-cycle management and the benefits of project management to an organization.
Compare between a trend-moving and centered-moving average : Compare between a trend-moving average and a centered-moving average.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Reconnaissance tools

Enlist some of the popular reconnaissance tools, comparing three of the reconnaissance tools describing the advantages.

  Type of data standard

What type of data standard are we dealing with in each scenario (metadata, spatial or attribute)? You work for Town of Ancaster prior to an amalgamation of New City of Hamilton. Your main responsibility was to retain Town's single line road network f..

  Large programming team and perhaps work on multiple projects

You wonder how large programming teams be sure that they use the same naming conventions and that their programs work together even though they are created independently. You research the Internet and any resources at your disposal for information..

  Registers and memory address

Suppose that the .data section is mapped to the start at address 0x1800 in memory at run time, Provide the contents of the registers %r1-%r4.

  Identifying the malicious activity in the program

State the most effective method in order to find if an attack has been made on the computer network? Specify the malicious activities does your recommendation recognize?

  How to write a class named dayofyear that gets an integer

How to write a class named DayOfYear that gets an integer Day 2 would be January 2 Day 32 would be February 1 Day 365 would be December 31

  Produce two random integer numbers between 1 and 200

Produce two random integer numbers between 1 and 200.

  Establish separation of duties via role assignment

Setting security for each employee based on the specific role provides the tightest and most personalized security. The trade-off is increased amount of administration effort when setting up the specific roles to use and the access permitted for ea..

  Methods to target certain audience

Recognize a particular website which you frequently go to and explain the targeted audience which visit that particular site. Provide explanation how the site is developed for its certain target audience.

  What is the data rate

What is the data rate

  Xpath and xslt transformation

Explain the context in XPath. Explain at least three things you will require to perform an XSLT transformation.

  Choose one of the network tools found in a windows 2000

Select one of the network tools found in a Windows 2000 server. Look up use of this tool. Using a creative writing narrative format write a short story explaining how you will use this tool to keep the network running successfully.

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