non recursive quick sort