Added methods toArray(E[]) and toArrayList().
Reduced complexity of toArray(E[]) from O(3n) to O(2n) in the worst
case.