Click here to Skip to main content
15,909,945 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# test if number exists in array and if not put it in Pin
Luc Pattyn30-Dec-09 9:32
sitebuilderLuc Pattyn30-Dec-09 9:32 
AnswerRe: C# test if number exists in array and if not put it in PinPopular
Luc Pattyn30-Dec-09 8:47
sitebuilderLuc Pattyn30-Dec-09 8:47 
GeneralRe: C# test if number exists in array and if not put it in Pin
Wheels01230-Dec-09 8:58
Wheels01230-Dec-09 8:58 
GeneralRe: C# test if number exists in array and if not put it in Pin
Luc Pattyn30-Dec-09 9:12
sitebuilderLuc Pattyn30-Dec-09 9:12 
GeneralRe: C# test if number exists in array and if not put it in Pin
PIEBALDconsult30-Dec-09 10:56
mvePIEBALDconsult30-Dec-09 10:56 
AnswerRe: C# test if number exists in array and if not put it in Pin
Islorvat30-Dec-09 8:47
Islorvat30-Dec-09 8:47 
GeneralRe: C# test if number exists in array and if not put it in Pin
Wheels01230-Dec-09 8:59
Wheels01230-Dec-09 8:59 
GeneralRe: C# test if number exists in array and if not put it in Pin
Alex Manolescu30-Dec-09 9:46
Alex Manolescu30-Dec-09 9:46 
I have an idea of how you can solve you're problem, below are the steps:

Objective: What do we know? We know that you are looking for 2 identical numbers always. If there is only 1 number, then add his duplicate.

Solution:
Supose the number we are looking for his duplicate is X, the first number of the array.

1. sort the array

2. ask for the neighbour of the number X, at right!

if duplicate is at right
increment index to the next X number (skip the duplicate we found!)
else
append the number to the array and repeat step 1

3. repeat until the end of the array.


This is the pseudocode of the solution I've taught.
Hope this helps. Smile | :)

Cheer's,
Alex Manolescu.
GeneralRe: C# test if number exists in array and if not put it in Pin
#realJSOP30-Dec-09 9:48
professional#realJSOP30-Dec-09 9:48 
GeneralRe: C# test if number exists in array and if not put it in Pin
Alex Manolescu30-Dec-09 9:54
Alex Manolescu30-Dec-09 9:54 
GeneralRe: C# test if number exists in array and if not put it in Pin
#realJSOP30-Dec-09 23:45
professional#realJSOP30-Dec-09 23:45 
GeneralRe: C# test if number exists in array and if not put it in Pin
Alex Manolescu31-Dec-09 0:30
Alex Manolescu31-Dec-09 0:30 
AnswerRe: C# test if number exists in array and if not put it in Pin
Jimmanuel30-Dec-09 10:02
Jimmanuel30-Dec-09 10:02 
AnswerRe: C# test if number exists in array and if not put it in Pin
petercrab30-Dec-09 18:20
petercrab30-Dec-09 18:20 
GeneralRe: C# test if number exists in array and if not put it in Pin
Luc Pattyn31-Dec-09 0:24
sitebuilderLuc Pattyn31-Dec-09 0:24 
GeneralRe: C# test if number exists in array and if not put it in Pin
Alex Manolescu31-Dec-09 0:30
Alex Manolescu31-Dec-09 0:30 
GeneralRe: C# test if number exists in array and if not put it in Pin
Wheels01231-Dec-09 1:53
Wheels01231-Dec-09 1:53 
QuestionHow can I print-out my data in DataGridView using a printer? Pin
Emmet_Brown30-Dec-09 7:46
Emmet_Brown30-Dec-09 7:46 
AnswerRe: How can I print-out my data in DataGridView using a printer? Pin
sanforjackass30-Dec-09 8:13
sanforjackass30-Dec-09 8:13 
GeneralRe: How can I print-out my data in DataGridView using a printer? Pin
Emmet_Brown30-Dec-09 8:14
Emmet_Brown30-Dec-09 8:14 
QuestionI want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 6:07
Alex Manolescu30-Dec-09 6:07 
AnswerRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
ProtoBytes30-Dec-09 6:39
ProtoBytes30-Dec-09 6:39 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 6:56
Alex Manolescu30-Dec-09 6:56 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
ProtoBytes30-Dec-09 7:07
ProtoBytes30-Dec-09 7:07 
GeneralRe: I want to modify/replace some data from a binary file without loadig the file in memory. Pin
Alex Manolescu30-Dec-09 8:27
Alex Manolescu30-Dec-09 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.