lets say i have this array--> arr[5]={1,3,4,2,0} the function starts with arr[0] and goes to the next array index depending on arr[0] value, for example in this case arr[