👉 In mathematics, an inversion is a mathematical operation that swaps two elements in a set. In other words, it returns the element at one position to the other. This operation is often used in programming and data structures to swap elements. For example: ``` int arr[] = {1, 2, 3, 4}; int i = 0; while (i < arr.length) { int temp = arr[i]; arr[i] = arr[arr.length - 1