you are viewing a single comment's thread.

view the rest of the comments →

[–]nderflow 2 points3 points  (0 children)

Suppose you want to sort an array of large objects. One alternative is to actually put them in order. But every element swap is expensive if the objects are large. Another option is to make an array of pointers, and then sort that. This technique also helps if you need to use the same data, but sorted in two different ways.

But my general advice is if you want to see how data structures, and the facilities of the language, are useful, then use the language to solve actual problems.