3 ms·
Why would you hold 10,000 elements in a linked list?
by zoren 9y ago
Why would you hold 10,000 elements in a linked list?
- mcguire 9y agoI couldn't hold them in my cupped palms.
- fsloth 9y agoThat's just - for example - every point in 100×100 R^2 cartesian grid. 10k elements is not by any measure a 'large number of elements'. Just pick your algorithmic use case for a good excuse to use list and not an array from here: http://bigocheatsheet.com http://bigocheatsheet.com
- eru 9y agoWhen you first write design your program, you might indeed use a different data structure than a linked list when you anticipate 10k+ elements. But often programs are used long after they are designed, and it is great if they can degrade gracefully as you move outside their original design parameters.