Click here to Skip to main content
15,860,972 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff12-May-21 22:13
professionalBillWoodruff12-May-21 22:13 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
honey the codewitch12-May-21 23:27
mvahoney the codewitch12-May-21 23:27 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff13-May-21 0:06
professionalBillWoodruff13-May-21 0:06 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
honey the codewitch13-May-21 0:14
mvahoney the codewitch13-May-21 0:14 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff13-May-21 20:26
professionalBillWoodruff13-May-21 20:26 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
honey the codewitch13-May-21 23:47
mvahoney the codewitch13-May-21 23:47 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff14-May-21 1:19
professionalBillWoodruff14-May-21 1:19 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
honey the codewitch14-May-21 1:41
mvahoney the codewitch14-May-21 1:41 
List<t> doesn't shrink it's capacity. It grows and grows and grows and grows.

But I was wrong about SortedSet<T> after looking at SortedSet.cs in the reference implementation. Sorry.

I could have sworn they implemented it like Dictionary<TKey,TValue>.

In the dictionary they use a hashtable, but the hash just holds indexes into an internal array that grows when you add items.

In sorted set it's just a straight binary tree. unoptimized. So you were right about it shrinking on remove.

I should have looked it up before I said something. Mea culpa.

I don't trust any SortedXXXXX implementation under the ComponentModel now after seeing that.

Unfortunately the way to do it would be to reimplemented sorted set properly so instead of say

C#
class Node {
   public Node Left;
   public Node Right;
}


It should be
C#
struct Node {
    public int LeftIndex;
    public int RightIndex;
}

with
C#
Node[] m_nodeList;


as an internal member, and that should grow.

That's how dictionary for example does things except it uses a hash instead of a tree.

Frown | :( Unsure | :~

ETA: The other option is to just use a sorted array. I'd consider that route.
Real programmers use butterflies

GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff14-May-21 15:28
professionalBillWoodruff14-May-21 15:28 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
Rich Leyshon12-May-21 3:17
Rich Leyshon12-May-21 3:17 
JokeRe: a new word for the special kind of chagrin you experience when ... Pin
W Balboos, GHB12-May-21 5:57
W Balboos, GHB12-May-21 5:57 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
Chris Maunder12-May-21 6:13
cofounderChris Maunder12-May-21 6:13 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff12-May-21 15:00
professionalBillWoodruff12-May-21 15:00 
JokeRe: a new word for the special kind of chagrin you experience when ... Pin
Daniel Pfeffer12-May-21 6:20
professionalDaniel Pfeffer12-May-21 6:20 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff12-May-21 14:53
professionalBillWoodruff12-May-21 14:53 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
obermd13-May-21 4:33
obermd13-May-21 4:33 
GeneralRe: a new word for the special kind of chagrin you experience when ... Pin
BillWoodruff13-May-21 20:20
professionalBillWoodruff13-May-21 20:20 
GeneralIf you like Computer History Pin
raddevus12-May-21 2:55
mvaraddevus12-May-21 2:55 
GeneralRe: If you like Computer History Pin
honey the codewitch12-May-21 3:12
mvahoney the codewitch12-May-21 3:12 
GeneralRe: If you like Computer History Pin
raddevus12-May-21 3:56
mvaraddevus12-May-21 3:56 
GeneralRe: If you like Computer History Pin
honey the codewitch12-May-21 3:59
mvahoney the codewitch12-May-21 3:59 
GeneralRe: If you like Computer History Pin
k505412-May-21 3:28
mvek505412-May-21 3:28 
GeneralRe: If you like Computer History Pin
g_p_l12-May-21 3:55
g_p_l12-May-21 3:55 
GeneralRe: If you like Computer History Pin
raddevus12-May-21 3:58
mvaraddevus12-May-21 3:58 
PraiseRe: If you like Computer History Pin
megaadam12-May-21 4:16
professionalmegaadam12-May-21 4:16 

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.