Lesson 32 of 34
HashMap: Key-Value சேமிப்பு
10 min 35 XP
HashMap ஒவ்வொரு key-க்கும் ஒரு value சேமிக்கும், அகராதி போல. Key மூலம் value-ஐ மிக வேகமாகப் பெறலாம். Key-கள் தனித்துவமானவை; அதே 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). வரிசை முக்கியமெனில் TreeMap (sorted keys) பயன்படுத்துங்கள்.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.