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.