交互设计算法基础(4) - Hash Table
2017-09-16 12:04
288 查看
1 2 import java.util.Map; 3 4 // Note the HashMap's "key" is a String and "value" is an Integer 5 HashMap<String,Integer> hm = new HashMap<String,Integer>(); 6 7 // Putting key-value pairs in the HashMap 8 hm.put("Ava", 1); 9 hm.put("Cait", 35); 10 hm.put("Casey", 36); 11 12 // Using an enhanced loop to interate over each entry 13 for (Map.Entry me : hm.entrySet()) { 14 print(me.getKey() + " is "); 15 println(me.getValue()); 16 } 17 18 // We can also access values by their key 19 int val = hm.get("Casey"); 20 println("Casey is " + val);
Processing内建HASH Table(哈希表),倒是挺方便的,就不用自己动手写啦!!☆⌒(*^-゜)v
相关文章推荐
- 交互设计算法基础(1) - Binary Search
- 交互设计算法基础(3) - Quick Sort
- 九章算法 基础算法 强化算法 系统设计 大数据 安卓 leetcode 高清视频
- 算法设计与应用基础:第十二周(2)
- Apple Watch人机交互指南:UI设计基础--模态页面和布局
- iOS 人机交互指南之UI设计基础:Designing for iOS 7
- 算法设计与应用基础系列15
- 算法设计与应用基础-第四周
- 编程基础设计与算法-24种设计模式和7大原则
- 学点PYTHON基础的东东--数据结构,算法,设计模式---单向链表
- 算法设计与应用基础作业(二)
- Apple Watch人机交互指南:UI设计基础--颜色、字体
- 算法设计与结构基础作业第十六周
- 算法设计与应用基础:第九周
- 算法设计与应用基础系列16
- [Java基础巩固](0) --- 程序设计基础和基本数据结构, 算法
- 【总结】-第一章-算法设计基础
- 算法设计与应用基础:第三周
- 人机交互读书笔记之一(以用户为中心的设计和评估的理论基础和设计含义)
- (一) 算法设计基础