SrinivasNampalli / SRINIVCSA

CSA 2025 V1
Apache License 2.0
0 stars 0 forks source link

Isssue for popcorn #5

Open SrinivasNampalli opened 2 months ago

SrinivasNampalli commented 2 months ago

Changes made for rightward shift: Store the last element (temp = words[words.length - 1];). Shift all elements right (words[index] = words[index - 1];), so each element moves to the next position. Place the last element at the beginning (words[0] = temp;).

if (array[i] > array[i - 1]) { System.out.println("Increase"); }