Read the algorithm, then guess its Big-O time complexity: 8 levels of algorithm analysis. A quick Big-O practice game. 8 levels, right in the browser.
Mr. Fajar does not guess from the look of the code, he counts. Every function call, every pass of a loop, every condition checked, and every element a built-in touches is one step. Then he doubles the queue, 8, 16, 32, 64, 128 buyers, and watches what happens to the steps each time the queue doubles: they stay the same, grow a little, double too, a bit more than double, go four times, or are squared. Those are the six growths on his board.
The numbers on the board can get big, so Mr. Fajar does not read their size, he reads their multiplier: the steps at size 2n divided by the steps at size n. Compare the two largest sizes, because there the steps that happen only once (the first call, the last check) blur the least.
Time is not the only thing that grows. Every value that is kept takes room in memory: an array filled inside a loop can grow as fast as its loop. Mr. Fajar counts steps, but Mrs. Ijah also needs table room for every glass.
Data that is already sorted gives a shortcut: one comparison in the middle already tells which half need not be opened again. Shuffled data does not: what you look for could be anywhere.
slice, concat and a spread [...x] are not free: they copy every element they hand back into a new array. Copying k elements is k steps, and the copy takes room until it is no longer used.
O(f) means "grows no faster than f": an upper bound, and it may be loose. Θ(f) means "grows exactly as fast as f": an upper and a lower bound at once. Code that takes n + 1 steps is rightly called O(n) and also O(n²), but only Θ(n) is exact.