Finding a key from range in hashmap

Multi tool use


Finding a key from range in hashmap
Problem
From below list of items I will need to access the item by identifying key range with given value for instance lets say if the value is 2.1.1 which is in degree, minutes & seconds I need to find key 0.0.0-30.0.0
performance is high priority.
key: 0.0.0-30.0.0 value: x-y-z
key: 30.0.0-60.0.0 value: y-x-z
key: 60.0.0-90.0.0 value: z-y-z
Solution1:
Below solutions I have attempted so far
recreate new key/value (json) file as below
key: 0.0.0 value: x-y-z
key: 0.0.1 value: x-y-z
.
key: 0.0.59 value: x-y-z
.
key: 0.1.0 value x-y-z
key: 0.1.1 value x-y-z
key: 30.0.0 value: y-x-z
.
.
key: 30.0.59 value: y-x-z
.
key: 30.1.0 value: y-x-z
key: 30.1.1 value: y-x-z
key: 30.1.2 value: y-x-z
.
.
key: 30.1.59 value: y-x-z
key: 30.2.0 value: y-x-z
key: 30.2.1 value: y-x-z
key: 30-2.3 value: y-x-z
.
.
key: 60.0.0 value: z-y-x
key: 60.0.1 value: z-y-x
key: 60.0.2 value: z-y-x
.
.
key: 60.0.59 value: z-y-x
key: 60.1.0 value: z-y-x
key: 60.1.1 value: z-y-x
.
.
Issue(s)
The issue with above solution is the file size will be increased which is causing heap overflow in my compact app
Solution2
?
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.