Program method that track the true runtime of your algorithm

Assignment Help Data Structure & Algorithms
Reference no: EM13853624 , Length:

You currently work in an algorithm development group for a large multimedia, mobile device corporation. Your group has been tasked with creating an app that will play an audio file backwards (from end to beginning rather than the standard beginning to end). Because this app is likely to be used on a mobile device, your group figures that this algorithm should use as little memory and space as possible. Your group has therefore decided to construct this reversal order algorithm such that it is an "in-place" algorithm. This simply means that the audio file will be loaded to memory and reversed using the same memory locations (because you must use memory sparingly).

Assignment

  • Part 1: 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. This algorithm will take as an input an array of ints and will reverse the order of the elements in the array, in place (essentially using only the memory in the array). For example, if the array contains five elements [1,2,3,4,5], the output of the algorithm will be [5,4,3,2,1]. Comment your program.
  • Part 2: Using this prototype, you will analyze the time complexity and space complexity of your algorithm in the worst case. Specifically, for time complexity, count the number of steps for each line of code, and write down the total lines executed as a mathematical expression where n is the size of the input array. For space complexity, write an expression for the number of memory locations and components that are required for algorithm in the worst case. (Assume that each int is one location.)
  • Part 3: Program a method or class that will track the true runtime of your algorithm. Find the true runtime of your algorithm using arrays of varying sizes (e.g., n = 500, n = 1,500, and n= 2,500) using your new tool. Plot, on a Cartesian plane, the runtime of your algorithm as a function of the size of the input array, n.

Attachment:- IndividualProjects.rar

Reference no: EM13853624

Questions Cloud

Describe the process flow of a criminal case : Describe the process flow of a criminal case that has gone to trial instead of being settled through a plea bargain
Importance of ethical behavior within criminal court system : Importance of ethical behavior within the criminal court system. Ethical behavior must exist within a criminal court system to ensure defendants receive fair trials
Pro forma balance sheet and pro forma income statement : Prepare the pro forma Balance Sheet and pro forma Income Statement. The EFR will be a plug number that makes the balance sheet balance like in the class example.
Types of ethical violations within the criminal court system : Identify and discuss at least three types of ethical violations within the criminal court system that can have a negative impact on the court hearing process for a defendant
Program method that track the true runtime of your algorithm : Program a method or class that will track the true runtime of your algorithm. Find the true runtime of your algorithm using arrays of varying sizes.
Target proportions of firm a capital structure : The following balance sheet reflects market values of the target proportions of Firm A's capital structure.
Current market value of the firm : What is the current market value of the firm? What will the firm's market value be after the announcement of the new debt issue? (Note that total market value of debt will be D0 + D1 and the interest costs that must be subtracted from EBIT when ca..
Indifferent between the two investments : At what interest rate would you be indifferent between the two investments? At interest rates above/below this break-even rate, which investment would you choose and why?
Prepare entries to record the flow of costs into department : Prepare entries to record The flow of costs into Department 1 for direct materials, direct labor, overhead and The transfer of production costs to Department.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Question 1a for n 0 what is the time complexity of the

question 1a for n ? 0 what is the time complexity of the method q1 n. show the details of your calculation of oq1 n

  Explain the need for complex data structures

Explain the need for complex data structures. Explain the design and application of arrays to program logic and data manipulation.

  Determine how long the specific algorithms take

Some problems can be theoretically solved (we can explain the algorithm solving problem). How long does the specific algorithms take?

  Online vs. face-to-face classes

Communication A significant distinction between online and face-to-face classes lies in the area of communication.

  Explaining simple symmetric encryption algorithm

Consider a simple symmetric encryption algorithm as follows:Is it a problem if the first block of input happens to be the same as the key? Explain why?

  Calculate the size of the state space as a function of n

n vehicles occupy squares (1, 1) through ( n , 1) (i.e., the bottom row) of an n × n grid. The vehicles must be moved to the top row but in reverse order

  Homogeneous array

Assume that a homogeneous array with six rows and eight columns, is stored in row major order starting at address 20. If each entry in the array requires only one memory cell.

  Write algorithm to calculate the volume of water

Write an algorithm to calculate the volume of water in cubic feet, flowing through pipe of diameter d in feet, with a velocity of v feet per second.

  Calculate worst-case run-time complexity of algorithm

Calculate the worst-case run-time complexity of your algorithm and prove optimality of the solution it gives. Suppose that the road is a straight line with a western end and an eastern end.

  Determine how the representation of internal data

Imagine you are asked to write a program to print out a yearly calendar. In this program, the user enters the year desired, and the output is a calendar for that year. Determine how the representation of internal data will affect the way in which ..

  Explain consensus algorithm

"Consensus algorithm": A group of ten people need to decide which one flavor of ice cream they will all order, out of three options.

  Creating an access database

PLUS is a corporation that makes all types of visual aids for judicial proceedings. Customers are usually private law firms, although the District Attorney's office has occasionally contracted for its services.

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