Click here to Skip to main content
15,909,530 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: My local SQL Server database and .NET application.?????? Pin
Wendelius9-Nov-08 9:32
mentorWendelius9-Nov-08 9:32 
QuestionAny fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat97-Nov-08 13:10
supercat97-Nov-08 13:10 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Luc Pattyn7-Nov-08 14:26
sitebuilderLuc Pattyn7-Nov-08 14:26 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat97-Nov-08 18:56
supercat97-Nov-08 18:56 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Kevin McFarlane8-Nov-08 0:50
Kevin McFarlane8-Nov-08 0:50 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat98-Nov-08 9:37
supercat98-Nov-08 9:37 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Kevin McFarlane8-Nov-08 9:43
Kevin McFarlane8-Nov-08 9:43 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Luc Pattyn8-Nov-08 2:49
sitebuilderLuc Pattyn8-Nov-08 2:49 
Hi,

1.
Array.IndexOf() returns the first match, which makes it essentially a linear search.
What you want is a "find any" that scales well, let's say a hash table.
As you know, when searching becomes expensive, you must invest in sorting, and the best way
for sorting often is "sort while growing" i.e. keep the list sorted at all times.

2.
.NET has a SortedList class, which is actually a Dictionary. It keeps its keys in sorted order
at all times.

3.
Wouldn't it be better to inherit from Dictionary and add the functionality you want?
I guess you can replace the Add and Remove methods, so you are aware of those operations,
then create your own IEnumerable implementation which could use indices and "return yield".

4.
It may be unwise to come up with an IEnumerable that behaves quite differently from regular
IEnumerables, those that do fail when the collection gets modified at all.

5.
You might use Reflector (or look into the Rotor source) to see how they went about it
in the first place.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Mark Salsbery8-Nov-08 6:15
Mark Salsbery8-Nov-08 6:15 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat98-Nov-08 9:25
supercat98-Nov-08 9:25 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Luc Pattyn8-Nov-08 12:36
sitebuilderLuc Pattyn8-Nov-08 12:36 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat98-Nov-08 14:08
supercat98-Nov-08 14:08 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Luc Pattyn8-Nov-08 15:38
sitebuilderLuc Pattyn8-Nov-08 15:38 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat99-Nov-08 6:17
supercat99-Nov-08 6:17 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Luc Pattyn9-Nov-08 7:57
sitebuilderLuc Pattyn9-Nov-08 7:57 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's [modified] Pin
supercat99-Nov-08 15:29
supercat99-Nov-08 15:29 
AnswerRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
Mark Churchill9-Nov-08 12:44
Mark Churchill9-Nov-08 12:44 
GeneralRe: Any fast way to do Array.IndexOf(Of Integer)() without DLL's Pin
supercat99-Nov-08 15:50
supercat99-Nov-08 15:50 
QuestionI am a novice at this, where can I post a job for .net developer? Pin
PhyllisM7-Nov-08 9:54
PhyllisM7-Nov-08 9:54 
AnswerRe: I am a novice at this, where can I post a job for .net developer? Pin
Colin Angus Mackay7-Nov-08 10:37
Colin Angus Mackay7-Nov-08 10:37 
GeneralRe: I am a novice at this, where can I post a job for .net developer? Pin
Mark Salsbery8-Nov-08 6:20
Mark Salsbery8-Nov-08 6:20 
GeneralRe: I am a novice at this, where can I post a job for .net developer? Pin
Colin Angus Mackay8-Nov-08 6:43
Colin Angus Mackay8-Nov-08 6:43 
GeneralRe: I am a novice at this, where can I post a job for .net developer? Pin
#realJSOP9-Nov-08 23:55
professional#realJSOP9-Nov-08 23:55 
GeneralRe: I am a novice at this, where can I post a job for .net developer? Pin
Paul Conrad8-Nov-08 13:20
professionalPaul Conrad8-Nov-08 13:20 
AnswerRe: I am a novice at this, where can I post a job for .net developer? Pin
Paul Conrad8-Nov-08 13:18
professionalPaul Conrad8-Nov-08 13:18 

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.