The worst case time complexity of an efficient algorithm to get the last index for an actually filled element in an array would be O(n). This is because you would have to check each element in the array one by one until you find the last element that has been filled. You cannot do better than this because you have to check all the elements in the worst case scenario. If the array is not filled in a sorted order, you cannot use a binary search or any other algorithm with a lower time complexity because the array is not sorted and you do not have any other information about the distribution of the elements in the array.