linked list - How is the built in C# linkedlist library so much quicker than a simple implementation? -
i have created barebones linkedlist following node type gets chained up:
class node { string somedatabecausewhynot; node next; node previous; }
while iterating on nodes delete so:
void removenode(node n) { n.next.previous = n.previous n.previous.next = n.next }
this solution 3x slower c# linkedlist.remove function.
i can't imagine why , love know difference in internal c# implementation makes quicker?
Comments
Post a Comment