Algorithm: efficient way to remove duplicate integers from an array

前端 未结 30 2601
离开以前
离开以前 2020-11-22 16:03

I got this problem from an interview with Microsoft.

Given an array of random integers, write an algorithm in C that removes duplicated numbers an

30条回答
  •  耶瑟儿~
    2020-11-22 16:35

    Let's see:

    • O(N) pass to find min/max allocate
    • bit-array for found
    • O(N) pass swapping duplicates to end.

提交回复
热议问题