1. use an array of bit to mark whether a number has shown up. 2. (if the numbers are integer) use an array of int to mark the number of times an integer shown up, then find the median by that array (not integer) you can refer to a question of finding the median from two blocks in the thread about the faceboook question