We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
True.
Count the inversions, and then iterate once through the array to find the minimum and maximum value (in the end the first and last element as the array is sorted).
O(n^2) -> O(n).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sorting: Bubble Sort
You are viewing a single comment's thread. Return to all comments →
True. Count the inversions, and then iterate once through the array to find the minimum and maximum value (in the end the first and last element as the array is sorted). O(n^2) -> O(n).