Algorithm: efficient way to remove duplicate integers from an array

前端 未结 30 2766
离开以前
离开以前 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:39

    this is what i've got, though it misplaces the order we can sort in ascending or descending to fix it up.

    #include 
    int main(void){
    int x,n,myvar=0;
    printf("Enter a number: \t");
    scanf("%d",&n);
    int arr[n],changedarr[n];
    
    for(x=0;x

提交回复
热议问题