Patrick T. answered 03/19/19
Tutor
4.7
(141)
Expert Algebra 1 and 2 Tutor
The time complexity is O(n2).
There are 8 corners, 12(n-2) edge pieces and 6(n-2)2 face pieces. Add everything together and you get a quadratic function which is nearly equal to O(n2).
I hope this helps. Please contact me if you would like additional help.