Click here to Skip to main content
15,917,174 members
Home / Discussions / C#
   

C#

 
AnswerRe: Duplicates in a Arraylist Pin
Abhijit Jana19-Apr-09 22:32
professionalAbhijit Jana19-Apr-09 22:32 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd20-Apr-09 3:15
professionalVimalsoft(Pty) Ltd20-Apr-09 3:15 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd23-Apr-09 2:05
professionalVimalsoft(Pty) Ltd23-Apr-09 2:05 
AnswerRe: Duplicates in a Arraylist Pin
OriginalGriff19-Apr-09 22:44
mveOriginalGriff19-Apr-09 22:44 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd20-Apr-09 3:16
professionalVimalsoft(Pty) Ltd20-Apr-09 3:16 
AnswerRe: Duplicates in a Arraylist Pin
N a v a n e e t h20-Apr-09 1:21
N a v a n e e t h20-Apr-09 1:21 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd20-Apr-09 3:22
professionalVimalsoft(Pty) Ltd20-Apr-09 3:22 
GeneralRe: Duplicates in a Arraylist Pin
Alan Balkany20-Apr-09 3:55
Alan Balkany20-Apr-09 3:55 
A good approach is to use a hash table of List<int>, indexed by strings.

For each staff name, if it's not in the hash table, add it with a new List<int> containing the single cycle number.

If the staff name IS in the hash table, just add the cycle number to the existing List<int> associated with the name. Then to display the result, for each name in the hash table, write the name following by every cycle number in the corresponding list.

This approach only requires one pass through the data, and doesn't require sorting. The running time is O(n).
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd7-May-09 3:18
professionalVimalsoft(Pty) Ltd7-May-09 3:18 
AnswerRe: Duplicates in a Arraylist Pin
#realJSOP20-Apr-09 3:08
professional#realJSOP20-Apr-09 3:08 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd20-Apr-09 3:25
professionalVimalsoft(Pty) Ltd20-Apr-09 3:25 
AnswerRe: Duplicates in a Arraylist Pin
PIEBALDconsult20-Apr-09 14:11
mvePIEBALDconsult20-Apr-09 14:11 
GeneralRe: Duplicates in a Arraylist Pin
Vimalsoft(Pty) Ltd7-May-09 3:17
professionalVimalsoft(Pty) Ltd7-May-09 3:17 
QuestionPublish : How i set the installing(Destination) path Pin
ddravin200019-Apr-09 21:48
ddravin200019-Apr-09 21:48 
AnswerRe: Publish : How i set the installing(Destination) path Pin
Abhijit Jana19-Apr-09 22:10
professionalAbhijit Jana19-Apr-09 22:10 
QuestionHow to insert relational Data with TableAdapter. Pin
hdv21219-Apr-09 21:30
hdv21219-Apr-09 21:30 
QuestionBinding data to the combobox Pin
Schdev19-Apr-09 21:14
Schdev19-Apr-09 21:14 
AnswerRe: Binding data to the combobox Pin
karlodegrano19-Apr-09 21:55
karlodegrano19-Apr-09 21:55 
AnswerRe: Binding data to the combobox Pin
Mycroft Holmes20-Apr-09 0:55
professionalMycroft Holmes20-Apr-09 0:55 
QuestionProblem with Directory Resolution Pin
Hiten Parmar19-Apr-09 21:06
Hiten Parmar19-Apr-09 21:06 
AnswerRe: Problem with Directory Resolution Pin
Vikram A Punathambekar19-Apr-09 21:23
Vikram A Punathambekar19-Apr-09 21:23 
QuestionCan I select which network connection (adapter) my application will use. Pin
shovaly19-Apr-09 20:20
shovaly19-Apr-09 20:20 
QuestionBHO varying in system to system? [modified] Pin
svt gdwl19-Apr-09 18:59
svt gdwl19-Apr-09 18:59 
QuestionVBA calling C# code? Pin
devvvy19-Apr-09 17:58
devvvy19-Apr-09 17:58 
AnswerRe: VBA calling C# code? Pin
Eddy Vluggen19-Apr-09 19:40
professionalEddy Vluggen19-Apr-09 19:40 

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.