Best algorithm for delete duplicates in array of strings

前端 未结 7 1887
一个人的身影
一个人的身影 2021-02-09 02:44

Today at school the teacher asked us to implement a duplicate-deletion algorithm. It\'s not that difficult, and everyone came up with the following solution (pseudocode):

<
相关标签:
7条回答
  • 2021-02-09 03:18

    Binary search will only work if the array you're searching is sorted. I guess that's not the case here, or you wouldn't be looping over your entire array in the inner loop of the original solution.

    0 讨论(0)
提交回复
热议问题