The Most Efficient Algorithm to Find First Prefix-Match From a Sorted String Array?

前端 未结 8 805
春和景丽
春和景丽 2021-01-31 00:27

Input:

1) A huge sorted array of string SA;

2) A prefix string P;

Output:

The index of the first string matching the input prefix if any. If ther

8条回答
  •  野性不改
    2021-01-31 00:35

    The FreeBSD kernel use a Radix tree for its routing table, you should check that.

提交回复
热议问题