If there are two sets -
set1 - [tag, boLD, Link]
set2 - [BOLd, TAG, Badge, foo]
What can be an effective algorithm for creating pairs of elements of type -
pairs = [tag, TAG], [boLD, BOLd], [Link, null], [null, Badge], [null, foo]
Note that pairing is based on names case-insensitive.
I want to avoid O (N ^ 2), which scans all the elements in set1 iteratively and scans the element in set2.
EDIT: I think that if we can use Ternary Search Triesto make an implementation of a character table, where the keys are elements from set1 and values from set2. set2 remaining elements can be processed finally.
source
share