13 ms·
Where did you learn CS that they didn't have lots of cyclic data structures? We had those even in our intro class at Berkeley...
by jblow 10y ago
Where did you learn CS that they didn't have lots of cyclic data structures? We had those even in our intro class at Berkeley...
- coldtea 10y agoI a few universities I know, including my own, cyclic data structures are on the curriculum, but nowhere near being taught as basic or intro stuff. That would lists, queues, trees, and hash-maps.
- topspin 10y agoIt occurs to me that these courses have been teaching what might (should?) be considered a naive view of memory; you show me a traditional cyclic data structure and I'll show you a concurrency bug. I suppose that's fine in 1978 when no one imagined they'd be dealing with multi-core microcontrollers, but today, when you find yourself using a "systems" language for non-toy work and you reach for a tool as sharp as a raw pointer, those naive data structures are frequently (usually?) inadequate.
- SamReidHughes 10y agoCyclic data structures are in my experience very useful for concurrency. It's probably the number three good excuse for using a linked list, when you want to hold a lock for O(1) time with no shenanigans. But also, generally, anything that involves communicating information from point A to point B, and waiting on that information, involves some sort of cyclic reference between the sender and listener.
- jblow 10y agoI have to completely disagree ... What are you even talking about? The inability to have circular links is deeply hobbling; they arise naturally in all kinds of circumstances.