If you have one million named objects and you want to store them in a data structure that lets you insert new objects quickly and search for an object by name quickly, what data structure should you use?
I think the most suitable here will be a dictionary solution - the tree where each node contains a letter. And each name will be a word in such a dictionary so we need the node also contains the sign that there is a name ends here (let's say -|). For example: