MERGED: Deleting duplicates in an array (plz help me out!!!!!!!)

Reply

Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: deleting duplicates in array

 
0
  #11
Oct 29th, 2004
Originally Posted by galmca
i have been online here for 2 hrs..almost and didn't get any reply from any1/../so i was checking on some other threads of this site....as im new to this site...so plz don't take it otherwise...and help me out.......plz with this problem......
2 hours?!?!? You've not gotten an answer in 2 hours, and you're complaining?!?!?

Come on now. We're doing this for free-- you have no right to complain even if we don't answer in 2 days! Please be more mindful in the future. If nobody answers your question promptly, it's likely because we don't have the answer, or the right person has not yet visited the site.

Please be more considerate of other forum members, and don't bump your post in the same day you posted.
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,625
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 717
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: deleting duplicates in array

 
0
  #12
Oct 29th, 2004
>it's likely because we don't have the answer, or the right person has not yet visited the site.
Or the first person who wanted to help was too insulted and deleted the meat of her post. Anyway, it's best to just ignore people like galmca. They go away after a short time and leave us in peace.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 10
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: deleting duplicates in array

 
0
  #13
Oct 29th, 2004
Well, galmca has legitemate questions and supplies some sample code, so s/he just needs to learn a little etiquate. That's better than the people who type in the question the professor posed and wants us to do their homework.
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,358
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 237
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: deleting duplicates in array

 
0
  #14
Oct 30th, 2004
  1. #include <stdio.h>
  2. int main(){int*i,*j,a[]={10,20,30,40,30};for(i=a;i<&a[sizeof a/sizeof*a];++i){for(j=a;j<i;++j){if(*i==*j){break;}}if(i==j){printf(&",%d"[i==a],*i);}}putchar('\n');return 0;}
Reply With Quote Quick reply to this message  
Join Date: Dec 2003
Posts: 2,414
Reputation: alc6379 has a spectacular aura about alc6379 has a spectacular aura about alc6379 has a spectacular aura about 
Solved Threads: 123
Team Colleague
alc6379's Avatar
alc6379 alc6379 is offline Offline
Cookie... That's it

Re: deleting duplicates in array

 
0
  #15
Oct 30th, 2004
Originally Posted by Chainsaw
Well, galmca has legitemate questions and supplies some sample code, so s/he just needs to learn a little etiquate. That's better than the people who type in the question the professor posed and wants us to do their homework.
Very true, but I think according to Narue, there's a trend possibly forming...
Alex Cavnar, aka alc6379
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,625
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 717
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: deleting duplicates in array

 
0
  #16
Oct 30th, 2004
Originally Posted by Dave Sinkula
  1. #include <stdio.h>
  2. int main(){int*i,*j,a[]={10,20,30,40,30};for(i=a;i<&a[sizeof a/sizeof*a];++i){for(j=a;j<i;++j){if(*i==*j){break;}}if(i==j){printf(&",%d"[i==a],*i);}}putchar('\n');return 0;}
What, no recursion?
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. a[20]={0};i=0;n=20;d(j)int(j);{j<n?printf("%-3i",
  4. j++[a]),d(j):putchar('\n');}e(j)int(j);{j<20?j++[
  5. a]=rand()%10,e(j):d(0);}f(j){j<n-1?j[a]=a[j+1],f(
  6. j+1):--n;}g(i,v)int(i),v;{return(i>=n?i:i[a]==v?f
  7. (i),g(i,v),i:g(i+1,v),i);}main(){!i?e(0):i==n?d(0
  8. ):0;return(i!=n?(i=g(i+1,i[a])),main():0);}
:mrgreen:
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 47
Reputation: galmca is an unknown quantity at this point 
Solved Threads: 0
galmca galmca is offline Offline
Light Poster

Re: deleting duplicates in array

 
0
  #17
Oct 30th, 2004
im really sorry but i didn't get the code which has been provided to me...it seems really complex when i read that....so could u plz help me out in the terms of the way i wrote....that way i'll be able to understand better...like to find out the duplicate element in an array...
for(i=0;i<5;i++)
{
for(j=0;j<5;j++)
{
if(a[i]==a[j])
printf("duplicate exists");
else
printf("duplicate does not exists");
}
}
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 47
Reputation: galmca is an unknown quantity at this point 
Solved Threads: 0
galmca galmca is offline Offline
Light Poster

Re: deleting duplicates in array

 
0
  #18
Oct 30th, 2004
is that way wrong?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 67
Reputation: N3wbi3C0d3r is an unknown quantity at this point 
Solved Threads: 0
N3wbi3C0d3r's Avatar
N3wbi3C0d3r N3wbi3C0d3r is offline Offline
Junior Poster in Training

Re: deleting duplicates in array

 
0
  #19
Oct 30th, 2004
I think on my part, Narue is a smart person, but does have a short fuse for newbies, i was new, but i found fast how to fit in better, read some other post's, to figure out how things go, some people arn't like me and go to the extent to fit in. galmca does have a good question, since ima newbie, and just learned the loops and what not, idont know how to helpm, Narue, you'r smart, but atleast don't be so rude about it, and yes galmca, i have 2 post'sd that have been here for days and, no answer, so i took matters into my own hands, and did it myself. They arn't paid, so sometimes, do it yourself has to be sufficient..
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 67
Reputation: N3wbi3C0d3r is an unknown quantity at this point 
Solved Threads: 0
N3wbi3C0d3r's Avatar
N3wbi3C0d3r N3wbi3C0d3r is offline Offline
Junior Poster in Training

Re: deleting duplicates in array

 
0
  #20
Oct 30th, 2004
That code there sounds about correct to me galmca, of course from above post, im new, and don;t know, but i just finished reading that section ;P
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC