r/computerscience • • May 25 '25

Discussion What exactly differentiates data structures?

I've been thinking back on the DSA fundamentals recently while designing a new system, and i realised i don't really know where the line is drawn between different data structures.

It seems to be largely theoretical, as stacks, arrays, and queues are all udually implemented as arrays anyway, but what exactly is the discriminating quality of these if they can all be implemented at the same time?

Is it just the unique combination of a structure's operational time complexity (insert, remove, retrieve, etc) that gives it its own 'category', or something more?

32 Upvotes

32 comments sorted by

View all comments

Show parent comment

9

u/NukeyFox May 26 '25

This is the right answer. The other answers keep mentioning about time/space complexity but having an efficient algorithms for the operations is a feature of supporting the operation in the first place.

I would add further that what defines an (abstract) data structure is the operations together with invariants on the operations.