Using the ideas of Lowrance and Wagner, this naive algorithm can be improved to be O ( M ⋅ N ) {\displaystyle O\left(M\cdot N\right)} in the worst case.
Korišćenjem ideje Lowrance i Wagner, ovaj naivan algoritam može se poboljšati da bude O ( M ⋅ N ) {\displaystyle O\left(M\cdot N\right)} u najgorem slučaju.