使用Hashmap构建英语词典! [英] Buliding English Dictionary Using Hashmap!

查看:145
本文介绍了使用Hashmap构建英语词典!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我在实验室工作中需要您的指导,我不知道如何开始。我应该实现一个存储英语单词及其多个同义词的字典。我需要使用hashmap来构建字典,HashMap中的数据列应该是一个链表。


请告诉我如何用链表实现hashmap !!!

Hello,
I need your direction in my lab assignment, i dont know how how to start. I am supposed to implement a dictionary that stores English words and their multiple synonyms. Am required to use hashmap to build the dictionary and the data column in the HashMap should be a linkedlist.

please tell me how can i implement the hashmap with a linkedlist!!!

推荐答案


你好,


我需要你的实验室指导,我不知道怎么开始。我应该实现一个存储英语单词及其多个同义词的字典。我需要使用hashmap来构建字典,而HashMap中的数据列应该是一个链表。



请告诉我如何实现hashmap有链表!
Hello,

I need your direction in my lab assignment, i dont know how how to start. I am supposed to implement a dictionary that stores English words and their multiple synonyms. Am required to use hashmap to build the dictionary and the data column in the HashMap should be a linkedlist.



please tell me how can i implement the hashmap with a linkedlist!!!



首先设计你的HashMap。什么是键类型和值类型是什么?

Design your HashMap first. What is the key type and what is the value type?



首先设计你的HashMap。什么是密钥类型,什么是价值类型?
Design your HashMap first. What is the key type and what is the value type?



好​​吧,每个单词必须是一个键,数据值必须是一个链表,我该如何设计HashMap?我从来没有使用它,当我阅读一些教程时,我没有得到它的完整图片。

Well, each word must be a key and the the data value have to be a linkedlist, how can i design the HashMap? i never used it and when i read some tutorials i didnt get the complete picture of it.



好​​吧,每个单词必须是一个键并且数据值必须是一个链表,我该如何设计HashMap?我从未使用它,当我阅读一些教程时,我没有得到完整的图片。
Well, each word must be a key and the the data value have to be a linkedlist, how can i design the HashMap? i never used it and when i read some tutorials i didnt get the complete picture of it.




你已经完成了!



关键是一个字(字符串)该值是单词的LinkedList。


现在使用泛型将其转换为Java声明(当然是使用1.5或更高版本?)



You are done!



The key is a word (String) the value is a LinkedList of words.

Now translate that to a Java declaration using generics (You are using 1.5 or later of course?)


这篇关于使用Hashmap构建英语词典!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆