Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java public static HashMap buildLastNametoFirstNameMap(String[] fullNames) { /*fullNames is an array of entries all in the format FirstName LastName, a first name and a last
Java
public static HashMap buildLastNametoFirstNameMap(String[] fullNames) { /*fullNames is an array of entries all in the format "FirstName LastName", a first name and a last name separated by a space. This function should return a map where the keys are the LastNames from the input array and the corresponding value is the associated FirstName. You may assume each LastName only occurs once in the input array. */ **Test input: an empty array: an array containing "Barry White" and "Bob Marley" public staic HashMap > buildLastNameToFirstName(String[] fulNames) { /*fullNames is an array of entries all in the format "FirstName LastName", a first name and a last name separated by a space. This function should return a map where the keys are the LastNames from the input array and the corresponding value is a list of all the FirstName that appeared with that LastName in the input array. */ } Test input: an empty array: an array containing "Barry White" and "Bob Marley": an array containing Barry White", "Bob Marley" and "Betty White". public static boolean IsPermutationFast(String string1, String string2) { /* This functions should return true if string 1 is a permutation of string2. In this case you should assume that means contains exactly the same characters, same case, including spaces. The strings may contain ascii or Unicode characters. For this question, you should optimize for very long input strings. */ **Test input: 2 empty Strings: "ab" "ba": "abc" "acd": "*rats*"star***": public static boolean IsPermutationLight(String string1, String string2) { /*This functions should return true if string1 is a permutation of string2. In this case you should assume that means contains exactly the same characters, same case, including spaces. The strings may contain ascii or unicode, characters. For this question, you should optimize for space and fairly short input strings. */ **Test input: Same as #8Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started