Find Jobs
Hire Freelancers

Array Methods Coding in Java

$10-30 USD

Annulleret
Slået op næsten 7 år siden

$10-30 USD

Betales ved levering
Part II – Write a method that will produce random permutations of the numbers 1 to 10. To generate a random permutation, you need to fill an array with the numbers 1 to 10 so that no two entries of the array have the same contents. One Idea: You could do it by brute force, by calling [login to view URL]() until it produces a value that is not yet in the array. That may take some time, and wouldn’t be efficient. Instead you should implement a smarter process. Another Idea: Make a second array and fill it with the numbers 1 to 10, then pick one of those at random, remove it from the values you are picking from in the second array and append it to the permutation array. Repeat this 10 times. Create a main method that will test this method along with a printArray(int [] arr) method to print it out. Print out 5 or 6 arrays in your main method created by your randomizing method to ensure it is working appropriately. Use comments to outline your logic for solving this problem. Methods main printArray(int [] arr) permutation(int[] arr) the output is suppose to look like this: [10, 1, 7, 6, 4, 8, 9, 2, 5, 3] [3, 2, 8, 7, 1, 6, 10, 4, 9, 5] [5, 9, 3, 8, 2, 6, 7, 1, 4, 10] [7, 5, 3, 9, 8, 2, 4, 1, 10, 6] [10, 6, 4, 9, 7, 1, 8, 5, 3, 2] java file permutation is a code that works but not the way professor wants it java file permutation1 is the format the way should it should be done
Projekt-ID: 13968367

Om projektet

Aktiv 7 år siden
Lokation: Albany, United States

Leder du efter muligheder for at tjene penge?

Fordele ved budafgivning på Freelancer

Fastsæt dit budget og din tidsramme
Bliv betalt for dit arbejde
Oprids dit forslag
Det er gratis at skrive sig op og byde på jobs

Om klienten

Flag for UNITED STATES
United States
0,0
0
Betalingsmetode verificeret
Medlem siden nov. 20, 2016

Klientverificering

Andre jobs fra denne klient

java Array Methods
$10-30 USD
Tak! Vi har sendt dig en e-mail med et link, så du kan modtage din kredit.
Noget gik galt, da vi forsøgte at sende din mail. Prøv venligst igen.
Registrerede brugere Oprettede jobs i alt
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Indlæser forhåndsvisning
Geolokalisering er tilladt.
Din session er udløbet, og du er blevet logget ud. Log venligst ind igen.