Java HashMap找到最佳匹配键(Java HashMap find best matching key)

编程入门 行业动态 更新时间:2024-10-25 18:22:54
Java HashMap找到最佳匹配键(Java HashMap find best matching key)

我有一个带有浮点键和字符串值的Java HashMap。 现在给定一个不在HashMap中的Float,我怎么找到与给定的Float最相似的键?

I have a Java HashMap with Float keys and String values. now given a Float which is not in the HashMap, how can i find the key which ist most similar to the given Float?

最满意答案

听起来像是java.util.NavigableMap实现之一的工作。

Sounds like a job for one of the implementations of java.util.NavigableMap.

更多推荐

本文发布于:2023-08-01 17:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1361289.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:HashMap   Java   find   key   matching

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!