Okay lets say I have an array arr[3][3]
and the values:
arr[0][0] = 12
arr[0][1] = 8
arr[0][2] = 3
arr[1][0] = 11
arr[1][1] =18
arr[1][2] = 9
arr[2][0] = 12
arr[2][1] = 9
arr[2][2] = 4
now I wanna find the maximum value, while the significance of the values is ascending. So the maximum would be arr[2], since arr[2][0] and arr[0][0] are the same and arr[2][1] > arr[0][1]. So the return values would be 2.
Whats the quickest way to find out the (first) index for the maximum (take into consideration that there may even be instances where all values of multiple indexes can the the same, in that case I need all max. indexes)
edit: nvm, had to rethink this for a second and it's not that hard after all.. so, this thread can be removed :D
Okay lets say I have an array arr[3][3]
and the values:
arr[0][0] = 12
arr[0][1] = 8
arr[0][2] = 3
arr[1][0] = 11
arr[1][1] =18
arr[1][2] = 9
arr[2][0] = 12
arr[2][1] = 9
arr[2][2] = 4
now I wanna find the maximum value, while the significance of the values is ascending. So the maximum would be arr[2], since arr[2][0] and arr[0][0] are the same and arr[2][1] > arr[0][1]. So the return values would be 2.
Whats the quickest way to find out the (first) index for the maximum (take into consideration that there may even be instances where all values of multiple indexes can the the same, in that case I need all max. indexes)
edit: nvm, had to rethink this for a second and it's not that hard after all.. so, this thread can be removed :D