Kdybys to 2D pole měl implementované ve skutečnosti jako 1D pole, tak vyhledáváš sekvenčně a máš složitost O(N).