Some Questions (1) How are collection objects in high level languages implemented internally? As link lists, I would guess? Is there not a performance hit with that? I would expect a Dictionary to be faster than a link list. If they are nothing but link lists with some meat on, then they must be slower than the link lists. K&R as well as Joel's Back to Basics article describes the disadvantages of malloc in terms of performance. Because malloc internally implements two link lists to used memory and the free chain, as the number of items in a collection grows, the Pop() must get more expensive.
Sathyaish Chakravarthy
3) Matrices can be used to solve mathematical network problems (that is one use).
Aussie Chick
If you really want to know the applied side of matrices, go look at Mathworks site, the company that makes Matlab: http://www.mathworks.com/
Yet another anon
This doesn't directly answer your question but talks about how perl internally implements lists and strings using normal C functions: http://www.perl.com/pub/a/2001/06/27/ctoperl.html
Matthew Lock
Matrices can be used to solve sets of linear algebraic equations. This comes in handy when displaying 3D graphics on a computer, for example.
"(1) How are collection objects in high level languages implemented internally? "
Tom H
>Matrices can be used to solve sets of linear algebraic equations. This comes in handy when displaying 3D graphics on a computer, for example.
Sathyaish Chakravarthy
As far as linked lists and collections go - when I used to develop in C, I implemented linked lists whenever I needed to store arbitrarily large ordered lists of items. I generally stopped creating my own linked list managers when collections became available as standard classes.
Bored Bystander
BB,
Sathyaish Chakravarthy
"Could someone please tell me why I would need a matrix in solving a real life problem?"
sgf
The advantage is that we don't have to keep reinventing the wheel to use high level data structures over and over again.
Matthew Lock
I honestly don't know what you're asking or debating. But being a masochist I'll take a stab.
Bored Bystander
Thanks for the spirit, BB. You've actually answered all that I had to ask. I am going to take your write home and yummy...feast, feast, feast, it'll be.
Sathyaish Chakravarthy
linked lists and arrays can be combined to give a meaningful synergy.
i like i
1) Depending on the Collection, some will be implemented as linked lists, but others will be implemented as arrays (many times Vectors, for example, will be implemented as arrays, with a realloc happenning when it needs more space). It slows down insertion into the middle (or beginning) of the Collection, but it greatly speeds up access/retrieval of arbitrary elements.
One of the Matts
Matrices are used in specifying ways to solve all manner of optimization problems. Find some info on linear programming. This will get you started. There are other methods that solve quadratic/non-linear problems too.
Rob VH
"Since puppet also has a homo-sexual connotation..."
straight as an arrow
> I would expect a Dictionary to be faster
Eric Lippert
> Could someone please tell me why I would
Eric Lippert
What about question 2?
Throwaway
Thanks, Eric! I am a little bit drunk at the moment, so I really don't understand anything. I'll get back later.
Sathyaish Chakravarthy
Fog Creek Home |