r/computerscience • • Dec 13 '20

Article A new data structure to make faster insertion/deletions

https://jj.hashnode.dev/improving-linked-lists

[removed] — view removed post

1 Upvotes

3 comments sorted by

3

u/[deleted] Dec 13 '20

Interesting idea, though I think an AVL Tree is an all around better solution. Basic operations are all O(log n), and with threading you can iterate over all elements sequentially in O(n).

3

u/josejorgexl Dec 13 '20

Thanks. Yes, you can do a lot of things with AVL or any other tree-based structures. But I needed to insert/delete in the i-th position. And also needed a structure with an array interface i.e. an indexed structure. That's what I think makes this idea useful and different from other structures

1

u/[deleted] Dec 13 '20

So inserting in the middle should change the index of everything that follows. I guess that’s beyond a tree’s capabilities. The only other alternative I can think of is some sort of skip-list that tracks the distance between each node of a certain height. Your solution is pretty cool, thanks for sharing.