Built-in Mathematica stuff
Mathematica has built in functions to do searching and sorting. In fact, you can define your own comparison functions.
To find an index, one can use the Position[ ] function. Here "10" shows up at positions 1 and 5.
And there's also a built in sorting function. The "Short" is just a way to keep from printing way to much stuff.
which can take a function of two arguments. This one sorts the list into even numbers and odd numbers.
So does this, with a funkier notation.
Created by Mathematica (September 29, 2004)