WPF ObservableCollection implementation details

Started by
0 comments, last by jwezorek 11 years, 2 months ago

Are ObservableCollections in WPF implemented as linked lists or as arrays?

Basically, is random access into an ObservableCollection constant time?

(Yes, I've googled; can find no discussion of this anywhere. I need to maintain an ObservableCollection in sorted order and am trying to figure out if it is worth it to do a binary search)

Advertisement

Nevermind ... found the answer here.

It's backed by a dynamic array. So O(1) random access lookups and amoritized O(1) inserts at the end. Regular inserts are O(n).

This topic is closed to new replies.

Advertisement