Final answer:
The basic operation of the provided bubble-sort algorithm is the comparison operation found on line 4, which defines the execution time of the algorithm. This comparison determines if a swap is necessary to sort the array elements.
Step-by-step explanation:
The student is asking about the basic operation of a bubble-sort algorithm. The basic operation of an algorithm is the operation that contributes the most to the total running time. In the case of the bubble-sort algorithm provided by the student, this would be the comparison operation performed on line 4 where it states if a[j]>a[j+1].
In bubble sort, this comparison is what determines whether two adjacent elements need to be swapped to ensure they are in the correct order. The number of times this comparison is executed dictates the time complexity of the algorithm, which for bubble sort is O(n^2) in the worst and average cases, where n is the number of elements in the array being sorted.