subject

This method determines if one int array is a permutation of another int array. "A permutation, also called an "arrangement number" or "order " is a rearrangement of the elements of an ordered list S into a one-to-one correspondence with S itself." [mathworld. wolfram] For example the list {1, 2} has the following permutations; {1, 2} and {2, 1}. Note the elements of listA and listB are lists, not sets, so duplicate items could appear. So for example given the list {1, 2, 2} the unique permutations are {1, 2, 2}, {2, 1, 2}, and {2, 2, 1}. {2, 1} is not a permutation of {1, 2, 2}., Another example of lists that are not permutations of each other: {2, 1, 1} is not a permutation of {2, 2, 1}. /* Determine if aData is a permutation of bData. pre: aData != null, bData != null post: return true if aData is a permutation of bData, false otherwise. Neither aData or bData are altered as a result of this method. */ public static boolean isPermutation(int[] aData, int[] bData) Hint: Do not try to solve the problem by taking one the arrays and generating all the permutations of that array and then check to see if the other array is one of those permutations. That is too inefficient except for arrays of a trivial length.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:20
What is a point-in-time measurement of system performance?
Answers: 3
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
question
Computers and Technology, 24.06.2019 16:30
Which program can damage your computer?
Answers: 1
question
Computers and Technology, 24.06.2019 16:50
Ramp charts are generally created in wordlotusexcelpowerpoint
Answers: 1
You know the right answer?
This method determines if one int array is a permutation of another int array. "A permutation, also...
Questions
question
Mathematics, 23.06.2019 01:00
question
Physics, 23.06.2019 01:00
Questions on the website: 13722361