Time complexity of removing duplicates in lists Question

I am wondering what is the minimum time complexity of get the unique value of a array in two conditions: keep the order or not.

For example, suppose we have a original array [3,6,1,1,2]. I want to get [3,6,1,2], this result keeps the original order and drops duplicates. If there is no need to keep the original order, [1,2,6,3] or [6,2,1,3] works fine.

I think time complexity of not keeping the order is $O(n)$ using a hashtable.
Under keeping order condition, approch may have a time complexity of $O(n^2)$. 


  So, Am I right? Can someone give a detailed prove the time complexity of the best in each condition?


For more infomation:

I use Python, I find 2 python code for drop duplicates in a list.


How do you remove duplicates from a list whilst preserving order?
removing duplicates in lists
The running time is expected $O(n)$ for both problems.  Simply scan over the input list, and as you examine each item, add it to the hashtable; if it wasn't already present, output it.  The running time is $(n)$ because, with a suitable hash function, the expected time it takes to insert or look up an item in a hash table is $O(1)$.

The worst-case running time with this approach is $O(n^2)$, but you can make the probability of this happening exponentially small with a suitably chosen hash function.

Alternatively, if you care a lot about worst-case running time, you can replace the hashtable with a self-balancing binary tree and achieve $O(n \log n)$ worst-case running time for both problems.