i am working on a small search engine to display a matching file names with full path. and important thing is that i need to provide wildcard(GLOB) search like *.doc
or *list*.xlx
or *timesheet*
or ???.doc
or something like that.
i found some related solution
but i am looking for efficient algorithms which can find matches out of million file names in a less than a second, so better than O(n) is required..
i am thinking of two phase algorithm with substring array (Suffix array + prefix array) search in first phase and normal RegEx search thru the results of first phase second phase.
any help would be greatly appreciated...