array complexity algorithms