Prefix *
192.168.*
192.168.2.*
192.168.2.1
IP Address
0.0.0.0
192.168.7.1
192.168.2.3
192.168.2.1
output
0.0.0.0 → *
192.168.7.1 → 192.168.*
192.168.2.3 → 192.168.2.*
192.168.2.1 → 192.168.2.1
Question
Map the address to correct prefix and if no prefix exists then match it to *
This was my question for my phone screen round and i bombed it. I didn't know it was Trie.
Comments (2)


