Find Jobs
Hire Freelancers

Array Methods Coding in Java

$10-30 USD

Cancelled
Posted almost 7 years ago

$10-30 USD

Paid on delivery
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
Project ID: 13968367

About the project

Active 7 yrs ago
Location: Albany, United States

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

About the client

Flag of UNITED STATES
United States
0.0
0
Payment method verified
Member since Nov 20, 2016

Client Verification

Other jobs from this client

java Array Methods
$10-30 USD
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.