Click here to Skip to main content
15,891,033 members
Home / Discussions / C#
   

C#

 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar19-Dec-09 2:28
Som Shekhar19-Dec-09 2:28 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen19-Dec-09 9:41
professionalEddy Vluggen19-Dec-09 9:41 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar19-Dec-09 20:16
Som Shekhar19-Dec-09 20:16 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Eddy Vluggen20-Dec-09 5:54
professionalEddy Vluggen20-Dec-09 5:54 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar20-Dec-09 18:22
Som Shekhar20-Dec-09 18:22 
AnswerRe: Continued Values Collection/List/Dictionary [modified] Pin
Gideon Engelberth16-Dec-09 15:05
Gideon Engelberth16-Dec-09 15:05 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 19:15
Som Shekhar16-Dec-09 19:15 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Gideon Engelberth17-Dec-09 3:31
Gideon Engelberth17-Dec-09 3:31 
Well, you could make your own Tuple if you really wanted, but it looks like you already have a similar class to use instead.

Like Eddy said, for your situation, you will have to loop somewhere. Either you have to keep a continuous list with the calculated values for all indexes up to the highest one, which implies a loop on every item insert/change, or you have to perform a search for the next lowest item and calculate its values on item access. It sounds like you want array-like access performance, so you will probably want to take the first option of calculating the values on insert (as Eddy suggested).

If you will be accessing the items in sequence and not randomly indexing, you could get the best of both worlds by writing an iterator that keeps a "current value" and "index" to keep the calculation time minimal.

A quick search did not find any existing implementation for such a collection, but it should not be that difficult to roll your own (especially since you know exactly what features you want).
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar17-Dec-09 3:42
Som Shekhar17-Dec-09 3:42 
AnswerRe: Continued Values Collection/List/Dictionary [modified] Pin
BillWoodruff16-Dec-09 16:55
professionalBillWoodruff16-Dec-09 16:55 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 19:17
Som Shekhar16-Dec-09 19:17 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar16-Dec-09 19:19
Som Shekhar16-Dec-09 19:19 
GeneralRe: Continued Values Collection/List/Dictionary Pin
BillWoodruff16-Dec-09 19:41
professionalBillWoodruff16-Dec-09 19:41 
GeneralRe: Continued Values Collection/List/Dictionary Pin
Som Shekhar18-Dec-09 19:02
Som Shekhar18-Dec-09 19:02 
Questionproblem with the tcp connetion. Pin
prasadbuddhika16-Dec-09 6:24
prasadbuddhika16-Dec-09 6:24 
AnswerRe: problem with the tcp connetion. Pin
Paulo Zemek16-Dec-09 9:11
mvaPaulo Zemek16-Dec-09 9:11 
QuestionSetup and Deployment Issue! Pin
Sr...Frank16-Dec-09 3:46
Sr...Frank16-Dec-09 3:46 
AnswerRe: Setup and Deployment Issue! Pin
Keith Barrow16-Dec-09 4:43
professionalKeith Barrow16-Dec-09 4:43 
AnswerRe: Setup and Deployment Issue! Pin
Seishin#16-Dec-09 4:46
Seishin#16-Dec-09 4:46 
GeneralRe: Setup and Deployment Issue! Pin
Sr...Frank16-Dec-09 8:49
Sr...Frank16-Dec-09 8:49 
GeneralRe: Setup and Deployment Issue! Pin
Keith Barrow16-Dec-09 9:10
professionalKeith Barrow16-Dec-09 9:10 
GeneralRe: Setup and Deployment Issue! Pin
Sr...Frank16-Dec-09 9:16
Sr...Frank16-Dec-09 9:16 
GeneralRe: Setup and Deployment Issue! Pin
Seishin#16-Dec-09 9:31
Seishin#16-Dec-09 9:31 
GeneralRe: Setup and Deployment Issue! Pin
Sr...Frank16-Dec-09 9:50
Sr...Frank16-Dec-09 9:50 
QuestionMoving from validation function to validation read only Property Pin
abcurl16-Dec-09 3:45
abcurl16-Dec-09 3:45 

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.