Why is DList insertion log n?

Ian ian at iangarcia.net
Sun Feb 16 18:46:56 UTC 2025


Hi,

I'm looking at the double linked list in std.containers and it 
says that insertion in front or back are O(log n). How come they 
are not O(1) ?

https://dlang.org/phobos/std_container_dlist.html#.DList.insertFront

Also, is this question more for "General"? I'm a "new user" and 
"learning" so it made sense here, but I'm learning my way around 
the forum.

  Ian


More information about the Digitalmars-d-learn mailing list