>>627419to iterate through every item in a list or other data structure and work with them while adding some kind of control variable on which item you're changing.
It's still really simple, it's just making it so the program stops when you hit the max list size or w/e and making sure it goes 1 item at a time.
Random example:
for(int j = i ; j < nums.length - 1; j++) {
if(nums[j] < nums[j + 1])
counter++;
else
break;
}