How to remove duplicates from a sorted array in C/C++

preview_player
Показать описание
Thank you for your support!
Рекомендации по теме
Комментарии
Автор

How to delete all the elements which have duplicates?

keshavrathore
Автор

Thank you. I understood it very easily.

FK__
Автор

thank you but how about get intersection of two char array find element in first arrary that not exist in secende one?

maloukemallouke
Автор

How can we find the dublicates characters in array and print them?

bluebutterfly
Автор

helpful tutorial, thank you, keep uploading 👍👍👍👍🙂🙂🙂🙂

SmartProgramming
Автор

Thanks for the videos. Can you please share a link to the code for every video that you have uploaded. It would be helpful to quickly play with it by making some changes in the already written code.

varudurock
Автор

thank you very much you help me so much

Okidoki
Автор

Your version saves first occurrence of repeated record ?
I need version which saves last occurrence
I will try to reverse the order of elements in array (should take size/2 swaps)
Remove elements in your way ( size iterations)
Reverse back the array with new size possibly smaller
Suppose we want to store duplicates in the
count..size-1 part of the array
How to modify your code
Is it possible to do this in the same time and space complexity ?
In if statement you overwrite an element of an array
Should we swap these elements instead of overwriting previous ?

holyshit
Автор

sir can u write the program for factorial of large number n=100

NeerajBugi
Автор

sir black scrn me kuch nhi dikh pata jb travling k time video play krte h so plz white color me vido bnaye

kapiljain
Автор

Can you make a video of how to remove duplicate from an unsorted array please

piyushatkare
Автор

put a[] = {1, 9, 16, 9, 7, 4, 9, 11} and you''ll find it frustrating

cedcamaing
Автор

why its not working for me ?
#define _CRT_SECURE_NO_WARNINGS
#include <string.h>
#include <stdio.h>
#define SIZE 6


int Eliminatedoubles(int arr[])
{
int i, j, temp = 0, count;
for (i = 0; i < SIZE; i++)
{
if (arr[i] != arr[temp])
{
arr[++temp] = arr[i];
}

}
count = temp + 1;
return count;

}


int main()
{
int i, count, arr[SIZE];
for (i = 0; i < SIZE; ++i)
{
scanf("%d", &arr[i]);
}
count = Eliminatedoubles(arr);
for (i = 0; i < count; ++i)
{
printf("%d", arr[i]);
}
return 0;
}

Ofirzz
Автор

Write the code for the following functions of list using an array .
a).Add. b). Remove. c).find
Sir kindly solve the Question and send the Answer plz

lslamicchannel