← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Design a data structure that supports inserting keys, looking up keys, and answering range queries (count how many keys fall in an interval [low, high]). You must provide two separate implementations: one using a hash table and one using a self-balancing binary search tree (BST). For each implementation, analyze the asymptotic time complexity of insert, lookup, and range_query operations. Then, in a short written comparison, explain when you would choose the hash-table version versus the BST version in a real system.