Best algorithm for delete duplicates in array of strings

前端 未结 7 2033
一个人的身影
一个人的身影 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 02:54

    You can often use a space-time tradeoff and invest more space to reduce time.

    In this case you could use a hash table to determine the unique words.

提交回复
热议问题