📜  数组java代码示例中的移位元素

📅  最后修改于: 2022-03-11 14:52:22.744000             🧑  作者: Mango

代码示例1
// Shift right from index of 'a' to 'b'
for(int i = b; i>a; i--) { array[i] = array[i-1]; }
/* Note: element at 'a' index will remain unchanged */

// Shift left from index of 'b' to 'a' 
for(int i = a; i