Find Jobs
Hire Freelancers

Write some assignments

$10-30 USD

Terminado
Publicado hace más de 7 años

$10-30 USD

Pagado a la entrega
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)
ID del proyecto: 11631459

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 8 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
Adjudicado a:
Avatar del usuario
$16 USD en 1 día
4,9 (1020 comentarios)
7,2
7,2
2 freelancers están ofertando un promedio de $21 USD por este trabajo
Avatar del usuario
+923245064587 my whats app i am expert in this subject inbox me ..........................................................................
$83 USD en 1 día
4,0 (4 comentarios)
3,0
3,0
Avatar del usuario
A proposal has not yet been provided
$25 USD en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de UNITED STATES
San Francisco, United States
5,0
6
Forma de pago verificada
Miembro desde ago 24, 2016

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.