This question already has an answer here:
Let's assume a very simplified situation. There is only one seller asking for 10$ and there is only one buyer bidding 20$. At what price would the transaction go?
Some answers say it won't, because the ask price has to match the bid price. (Does a market maker sell (buy) at a bid or ask price?) Other answers say, that the time ordering is important. (Bid-Ask at market open, which comes first?) Which answer is correct? What is the final price in the presented situation?