Find Jobs
Hire Freelancers

Write some assignments

$10-30 USD

Completed
Posted over 7 years ago

$10-30 USD

Paid on delivery
I need help with some assignments here and i need it with in 1 hour Assignment 1 : Information: Write code to fill an array of size n with unique random numbers in the range 0-10n (inclusive). Write one method that is O(n2) or worse and one that is O( n ). Recall that often a more efficient solution will require more memory! You can use the driver program to test your code. I recommend testing with a small array first to make sure your code works properly (perhaps n = 10). I also recommend first testing with random numbers in the range of 0-n, to make sure your code really works to select unique numbers. Then, you can increase the size to compare the running time. (I start to notice a difference at n = 10000!) (Hint: comment out the line that prints the array once you start using such big arrays!) Note the time for the linear and quadratic algortihms when n=10000. Then double the size to n=20000. You should notice that the linear running time also roughly doubles, while the quadratic running time roughly increases by 4x! (1)Write O( n ) code to fill the array. Hints: Recall that often a more efficient solution will use more memory. Can you use another array or an array of another type to help you create a more efficient solution? Only nested loops result in O(n2) efficiency. Consecutive loops can still be O( n ). (2)Write O(n^2) code to fill the array. Assignment 2: How many cell phones are sold each year in the U.S.? Estimate your answer and explain your reasoning. For this question, you will not be graded on your answer. You will be graded on whether your reasoning is logical. Explain how you get your estimate. A single number with no explanation will receive 0 points. Assignment 3: You are given an array of length n that contains positive and negative integers in random order. Write code that rearranges the integers so that the negative integers appear before the positive integers. Your code must be O( n ). Note: the numbers do not have to be sorted, just all negatives appear before all positives. Note: the number 0 does not appear in the array. You can use the driver program to test that your solution works.(I will upload the driver program file)
Project ID: 11631459

About the project

2 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
$16 USD in 1 day
4.9 (1020 reviews)
7.2
7.2
2 freelancers are bidding on average $21 USD for this job
User Avatar
+923245064587 my whats app i am expert in this subject inbox me ..........................................................................
$83 USD in 1 day
4.0 (4 reviews)
3.0
3.0
User Avatar
A proposal has not yet been provided
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
San Francisco, United States
5.0
6
Payment method verified
Member since Aug 24, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.