Here are a few: AppendTo[data, elem], Sort[data, test], in some cases use of ___ (as mentioned in David Wagner's book).
Edit:
A Wolfram Research developer explains here why Union[data,test] has quadratic complexity, and I am pretty sure the same applies to Sort[data,test]. The same Wolfram developer explains here that AppendTo[data,elem] has quadratic complexity. There are many math problems such as Inverse[matrix], FactorInteger[n] that are inherently expensive on large problems.
The most important answers to this question will be features in the core language that can kill the performance of a program. Sometimes you can greatly improve the performance of your program if you avoid such features.
Sort[data,test]? Generally, sorting is O(n log n). Check outTrace[Sort[{4, 3, 2, 1}, OrderedQ[{#1, #2}] &]] // Column. My guess is that Mathematica assumes that the function supplied as the second argument is one that yields an ordering on the supplied list, even though the user is free to supply a function that does not satisfy this. For example:Sort[{4, 3, 2, 1}, RandomChoice[{True, False}] &]. Mathematica therefore does not have to compare every two elements. For some fixed tests like2*Prime[#] < Prime[#2]&... – Jacob Akkerboom Jul 19 '13 at 19:50AppendTo. Here however, it is notAppendTothat is meant to have quadratic complexity, but rather a construction likeDo[AppendTo[list, f[k]],{k,n}]. This makes sense if copying a list has order has order n. Then copying a list n times has quadratic complexity. – Jacob Akkerboom Jul 21 '13 at 20:38Sortdoes not have quadratic complexity. Consider the sentence in your first link: "Union will not sort but rather test a given element against every other (remaining) element". I think the comparison with sort is made to show that in the case ofUnionit is necessary to compare all elements pairwise, whereas this is not the case when you wish to sort. I'm quite sure the guys at Mathematica implemented a fast sort algorithm with good assymptotic properties and the fact that sorting is O(n log (n)) as can be seen here. – Jacob Akkerboom Jul 21 '13 at 20:48Sort[data, test]can be executed in constant time. – Jacob Akkerboom Jul 21 '13 at 20:50