Which algorithm should be most efficient

Assignment Help Data Structure & Algorithms
Reference no: EM13696576

Question: Assume you have two algorithms, A and B, both of which perform the same function, although their implementations differ. Assume that algorithm A has a running time of O(N3 + 2N2 + 6N + 3) and algorithm B has a running time of O(6N2 + 4N + 10).

Also suppose that the value of N is restricted to the set of Natural numbers, including 0; i.e., {0, 1, 2, 3, ...}.

Answer the subsequent questions:

Part 1: Assuming the test conditions are equal for both algorithms, which algorithm should be most efficient when N is arbitrarily large (i.e., you can select N to be as large as you want it to be)?

Part 2: Assuming the test conditions are equal for both algorithms, which algorithm should be most efficient when N is arbitrarily small (i.e., you can choose N to be as small as you want it to be)?

Part 3: Assuming the test conditions are equal for both algorithms, at what value of N might both algorithms be expected to operate with the same efficiency?

Solve these parts in details and provide examples to support your rationale.

Reference no: EM13696576

Questions Cloud

Should the cio or cto report to the company president : Contact at least three people at your school or a nearby company who use information systems. List the systems, the position titles of the users, and the business functions that the systems support.
Sum of all odd numbers between a and b : The sum of all odd numbers between a and b (inclusive). Where a and b are read in by the user - Can you find the error in this code.
Represent 99 and -99 in 2s complement format : what are the largest(positive) and smallest (negative) integers a word can represent - Represent 99 and -99 in 2's complement format.
Determine the precise big-oh values : Determine the precise Big-Oh values for each of the following code samples, based on the number of statement executions - Remember to consider each statement in compound statements separately.
Which algorithm should be most efficient : the test conditions are equal for both algorithms, which algorithm should be most efficient when N is arbitrarily large (i.e., you can select N to be as large as you want it to be)?
Prepare an app that calculates the product of a series : Prepare an app that calculates the product of a series of integers that are passed to method   product using a variable-length argument list.
Translate the given code into mips64 assembly language : you can use the instructions 'blt' (branch on less than), 'ble' (branch on less or equal), 'bgt' (branch on greater than) and 'bge' (branch on greater or equal) - Translate the given code into MIPS64 assembly language.
Write a statement that prints the message recall : Clunker Motors Inc. is recalling all vehicles from model years 1995-1998 and 2004-2006. Given a variable modelYear - Write a statement that prints the message "Recall" to standard output if the value of modelYear falls within those two ranges.
Learn as much as possible about that ip address : Using tools that are freely available in the Web, learn as much as possible about that IP address (Domain name, owner, physical location, address, etc.)

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write a flowchart to print the largest of any 3 numbers

Write a flowchart to print the largest of any 3 numbers - Write a flowchart to print a product of 3 numbers.

  Communicationa significant distinction between online and

communicationa significant distinction between online and face-to-face classes lies in the area of

  Data structures assignment requiring c++ program

You should build enough new roads such that if City A was reachable from City B via some old roads, City A must be reachable from City B via some new roads.

  Determine minimum number of total nodes tree can have

If binary tree has height 4, determine minimum number of total nodes tree can have? c. If binary tree has height 4, determine the maximum number of total nodes tree can have?

  Show state of memory after processes by best fit algorithm

Using the best fit algorithm, show the state of memory after processes of 212K, 417K, 112K and 350K (in request order) arrive.

  Draw flowchart to print average for each student

Draw a flowchart to print the average for each student in a class. Input. Input consists of student records each containing a student's name(STUDENT-NAME), score for first test(TEST), score for second test(TEST2), and score for third test(TEST3)..

  In the present scenario of global warming the computer hard

in the present scenario of global warming the computer hard ware and software are also contributing for the increase in

  Write down a function which dynamically allocates an array

write a function that dynamically allocates an array of integers. the function should accept an integer argument

  Write algorithm for graph minimum number of semesters

You are given a DAG called G which is the prerequisite graph for a set of courses required for a degree. Each vertex corresponds to course. Provide a high-level description of algorithm which labels each vertex in G with minimum number of semesters..

  Data structures and algorithm design

Data Structures and Algorithm Design

  How to calculate signature using mod

How does he calculate the signature on each of m1j mod n (for positive integer j), m1-1 mod n, m1*m2 mod n, and in general m1j*m2k mod n (for arbitrary integers j and k)?

  Creating application - two dimensional array

Make an application that either sums or averages rows or columns of a 2-dimensional array depending on user choices.

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