in reply to Shorten a list...
A list which appears to the user as, say:
(1,2), (1,4), (1,7), (2,1), (3,5), (4,161), (4,1991)
could be physically represented in the actual application like this: (“Holy LISP, Batman!!”)
(1, (2,4,7)), (2,(1)), (3, (5)), (4, (161, 1991))
An abstract data type could be constructed which knew about this internal efficiency without exposing it to its clients, providing them a “list of 2-tuples” interface while, unbeknownst to them, actually storing it and/or indexing it in a more efficient way.