Created
December 12, 2017 11:43
-
-
Save tocttou/5c3864c2f956c768fe8b190efb3d8e67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import utils.FrequencyMap | |
fun main(args: Array<String>) { | |
val mutableMapOne = mutableMapOf<Int, Int>() | |
val freqMapOne = FrequencyMap<Int, Int>(mutableMapOne) | |
freqMapOne.add(1, 3) | |
freqMapOne.add(1, 2) | |
freqMapOne.add(Pair(2, 2)) | |
freqMapOne.removeFreq(2, 2) | |
println("FrequencyMap generated from MutableMap") | |
for (i in freqMapOne) println(i) | |
val mutableMapTwo = mutableMapOf<Int, Int>() | |
FrequencyMap<Int, Int>(mutableMapTwo).add(3, 4) | |
println("Using methods of FrequencyMap directly on MutableMap") | |
for (i in mutableMapTwo) println(i) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment