【发布时间】:2018-10-25 01:59:48
【问题描述】:
假设我有一个'the black top hat the red shirt the blue top hat' 的搜索查询。项目'the black top hat' 和'the red shirt' 存在于数组中,但'the blue top hat' 不存在于数组中。如果数组中存在这些项目,我将如何搜索,因为这些项目都组合成一个搜索字符串并且不是单独的。
我必须搜索'the', 'the black', 'the black top', ..., 'black', 'black top', etc...还是有更好的解决方案?
【问题讨论】:
标签: database string algorithm array-algorithms