Computer science
A simple but slow algorithm is: pick up two cards and check whether they are sorted correctly. If they are not, reverse them. Then do it again with another two, and repeat them all until they are all sorted. This is called a bubble sort. This method will work, but it will take a very long time.