Lesson 32 of 34
HashMap: Key-Value साठवण
10 min 35 XP
HashMap शब्दकोशासारखे प्रत्येक key साठी एक value साठवते आणि key ने value खूप वेगाने शोधते. Keys अद्वितीय असतात: तीच key पुन्हा put केल्यास तिची value बदलते.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.मोजणी हा HashMap चा क्लासिक वापर: map.put(w, map.getOrDefault(w, 0) + 1). Keys sorted क्रमाने हव्या असतील तर TreeMap वापरा.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.