This is a discussion on Duplicate elements from an array within the C and C++ Programming forums, part of the Software Development category; Hui Guys please let me know How to remove duplicate elements from an array...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Yes u can using a single pass of a loop.... but it may use an extra array space and the integer range shoould be specified... consider the array NUM[1...n] consdier all numbers in the array are within the range 1...k then we have another array A from 1...k then the loop would be... Code: for(i=0;i<n;i++)
{
if(A[NUM[i]]==0)
{
A[NUM[i]]=1;
}
if(A[NUM[i]]==1)
{
printf("%d",NUM[i]);
}
} integers....
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Duplicate Content | vadivelanvaidyanathan | Search Engine Optimization | 11 | 02-27-2008 11:10 AM |
| Removing duplicate rows in a DataSet | shaalini | ASP and ASP.NET Programming | 2 | 02-13-2008 09:33 PM |
| Would I get penalized for search engine duplicate content? | a.deeban | HTML, CSS and Javascript Coding Techniques | 1 | 09-05-2007 11:36 AM |
| What’s the difference between the System.Array.CopyTo() and System.Array.Clone() ? | Archer | C# Programming | 2 | 08-25-2007 03:00 AM |
| How can you sort the elements of the array in descending order In C#. NET 2005? | Archer | C# Programming | 1 | 07-24-2007 12:33 AM |