General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Anony Mousse
ForrestKnight
comments
Comments by "Anony Mousse" (@anon_y_mousse) on "8 Data Structures Every Programmer Should Know" video.
@loo_9 I'd thought about that some, and I was thinking that a similar technique to memory management could be applied by using a bit map to handle address offsets. Then each element could be directly-ish referenced with just one extra indirection. This would necessitate that each object is either a multiple of the byte size for the given platform or at the very least padded to it, but that's true even for regular scalar storage anyway.
1
The one point I disagree with is about the definition of an array. Same type for each slot and contiguous memory storage, yes, but not statically sized. And there's a lot more complexity to hash tables if you care to make a more complete description there. You have different hashing algorithms, balancing schemes, and even storage methods. For instance, in one implementation, I made the storage backing for a hash table as a balanced tree and each node was also part of an interlaced series of trees that were the chains. It used up a lot more memory than either a tree or a hash table alone, but it was an interesting experiment in maintaining sorted order while yielding slightly faster searches.
1
@jcm2606 Yeah, it doesn't matter whether it's from the heap or stack, all allocations in a computer are dynamic while at runtime. Yes, even a stack allocated array can be resized in place, with a few caveats.
1