473,387 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Looking for sorted collection classes that allows duplicate keys...

Hi,

I need to store my data on a sorted collection, where the sorting key can be
duplicated. I've been looking around .NET collection classes but they
expects unique keys for sorting. What can I do? Is any other resource for
..NET collections on the web?

Thanks in advance

--
Faustino Dina
--------------------------------------------------------
If my email address starts with two 'f'
drop the first 'f' when mailing me.
Nov 16 '05 #1
5 10114
arraylist ? then just call sort() you can override the add if you need
autosorting
"faustino Dina" <ff****@matusa.com.mx> wrote in message
news:uV**************@TK2MSFTNGP11.phx.gbl...
Hi,

I need to store my data on a sorted collection, where the sorting key can be duplicated. I've been looking around .NET collection classes but they
expects unique keys for sorting. What can I do? Is any other resource for
.NET collections on the web?

Thanks in advance

--
Faustino Dina
--------------------------------------------------------
If my email address starts with two 'f'
drop the first 'f' when mailing me.

Nov 16 '05 #2
> arraylist ? then just call sort() you can override the add if you need
autosorting

I was not aware of that method. I was thinking on a hashtable, but really I
don't need autosorting, just sort once and iterate. I'll try this. Thanks

Faustino
Nov 16 '05 #3
A hashtable is a poor structure for sorting ... it is great for searching
though ...
"faustino Dina" <ff****@matusa.com.mx> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
arraylist ? then just call sort() you can override the add if you need
autosorting I was not aware of that method. I was thinking on a hashtable, but really

I don't need autosorting, just sort once and iterate. I'll try this. Thanks

Faustino

Nov 16 '05 #4
Then do you recommend an ArrayList, or better a simple Array? I suppose the
sort() function for these is implemented as a quicksort that is well suited
for use on arrays. Am I right?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eN**************@TK2MSFTNGP12.phx.gbl...
A hashtable is a poor structure for sorting ... it is great for searching
though ...
"faustino Dina" <ff****@matusa.com.mx> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
arraylist ? then just call sort() you can override the add if you need
autosorting I was not aware of that method. I was thinking on a hashtable, but really I
don't need autosorting, just sort once and iterate. I'll try this.

Thanks
Faustino


Nov 16 '05 #5
is the data dynamic in size or fixed ? if dynamic I would use the arraylist.
"faustino Dina" <ff****@matusa.com.mx> wrote in message
news:un**************@TK2MSFTNGP09.phx.gbl...
Then do you recommend an ArrayList, or better a simple Array? I suppose the sort() function for these is implemented as a quicksort that is well suited for use on arrays. Am I right?

"Greg Young" <gr********@planetbeach.com> wrote in message
news:eN**************@TK2MSFTNGP12.phx.gbl...
A hashtable is a poor structure for sorting ... it is great for searching
though ...
"faustino Dina" <ff****@matusa.com.mx> wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
> arraylist ? then just call sort() you can override the add if you need > autosorting
I was not aware of that method. I was thinking on a hashtable, but

really
I
don't need autosorting, just sort once and iterate. I'll try this.

Thanks
Faustino



Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Dan H. | last post by:
Hello, I have an application that requires a collection that is sorted by a double field first, and then by a long field. So, lets say I have an class that has 2 fields called time, priority. I...
11
by: Pavils Jurjans | last post by:
Hello, There's some confusion about the purpose and difference between these handy classes... First, both of them are holding number of key - value pairs, right? Then, I see that there may be...
5
by: cody | last post by:
I know I can use ArrayList.ReadOnly() to create a readonly version of it, but how can I achive a similar thing with a generic collection of .NET 2.0?
1
by: Hal Heinrich | last post by:
Hi, I have a hastable with key/value pairs. I want to iterate thru the collection in descending order by value. What is the 'best practice' for handling this problem? Thanks in advance for...
6
by: Mike | last post by:
Hello guys, how are you? I implemented a class called MyDictionary that inherits from DictionaryBase. The thing is that my class, cannot handle a duplicate value in the "keys"
6
by: Burt | last post by:
I need to create a collection of classes (or structures) can be accessed by a string key, eg MyColl("ShortName5").Name for class with key ShortName5. But it also has to be sorted by a second...
18
by: Hunk | last post by:
Would like some advice on the fillowing I have a sorted list of items on which i require to search and retrieve the said item and also modify an item based on its identity. I think an Map stl...
8
by: Guy | last post by:
Is there a better way to search identical elements in a sorted array list than the following: iIndex = Array.BinarySearch( m_Array, 0, m_Array.Count, aSearchedObject ); aFoundObject= m_Array;...
7
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Can someone explain a few things about collections to me. In C# 2 generics, you can create a collection class by inheriting from System.Collections.ObjectModel.Collection. Using this you can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.