Complexity of Sorted Arryay in Get

when we get the minimum number in an sorted array , and after getting you have not changed the index of all other element after that , so you have written the complexity as O(1) but in an unsorted array , if we place minimum number at first index you have changed all other element index and for that complexity is O(n) but why you have not changed the index of other element in sorted array?

In get operation we are not removing the element from the array. I simply means that we need to check what’s the smallest element present in the array.
As the array is sorted, the smallest element will always be present at the 0th index.(We are not deleting this value from the array)

Incase of unsorted array, we need to traverse the whole array in order to determine the smallest element present in it.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.