Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 348 Weeks Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 03 May 2017 My Price 7.00

Write a method called reverse that accepts a map

Write a method called reverse that accepts a map from strings to strings as a parameter and returns a new map that is the reverse of the original. The reverse of a map is a new map that uses the values from the original as its keys and the keys from the original as its values. Since a map’s values need not be unique but its keys must be, you should have each value map to a set of keys. In other words, if the original map maps keys of type K to values of type V, the new map should map keys of type V to values that are Sets containing elements of type K. For example, the map {42=Marty, 81=Sue, 17=Ed, 31=Dave, 56=Ed, 3=Marty, 29=Ed} has a reverse of {Marty=[42, 3], Sue=[81], Ed=[17, 56, 29], Dave=[31]}. (The order of the keys and values does not matter.)

 

 

 

Answers

(8)
Status NEW Posted 03 May 2017 02:05 PM My Price 7.00

-----------

Attachments

file 1493823223-answer1.docx preview (228 words )
W-----------rit-----------e a----------- me-----------tho-----------d c-----------all-----------ed -----------rev-----------ers-----------e t-----------hat----------- ac-----------cep-----------ts -----------a m-----------ap -----------fro-----------m s-----------tri-----------ngs----------- to----------- st-----------rin-----------gs -----------as -----------a p-----------ara-----------met-----------er -----------and----------- re-----------tur-----------ns -----------a n-----------ew -----------map----------- th-----------at -----------is -----------the----------- re-----------ver-----------se -----------of -----------the----------- or-----------igi-----------nal-----------. T-----------he -----------rev-----------ers-----------e o-----------f a----------- ma-----------p i-----------s a----------- ne-----------w m-----------ap -----------tha-----------t u-----------ses----------- th-----------e v-----------alu-----------es -----------fro-----------m t-----------he -----------ori-----------gin-----------al -----------as -----------its----------- ke-----------ys -----------and----------- th-----------e k-----------eys----------- fr-----------om -----------the----------- or-----------igi-----------nal----------- as----------- it-----------s v-----------alu-----------es.----------- Si-----------nce----------- a -----------map-----------’-----------s v-----------alu-----------es -----------nee-----------d n-----------ot -----------be -----------uni-----------que----------- bu-----------t i-----------ts -----------key-----------s m-----------ust----------- be-----------, y-----------ou -----------sho-----------uld----------- ha-----------ve -----------eac-----------h v-----------alu-----------e m-----------ap -----------to -----------a s-----------et -----------of -----------key-----------s. -----------In -----------oth-----------er -----------wor-----------ds,----------- if----------- th-----------e o-----------rig-----------ina-----------l m-----------ap -----------map-----------s
Not Rated(0)