hi expert,
I have a 2 D array and i need to look the last occurrence of a string in one of column of that 2 d array. please note this column is sorted.
array(1,1) = 3
array(2,1)= 3
array(3,1)= 5
array(4,1)= 5
array(5,1)= 5
array(6,1)= 5
array(7,1)= 7
array(8,1)= 7
i am doing a loop in that array and when at row 3, i get [5] as value. How can i quickly get the last occurrence index of [5] without doing another loop ?
The last occurrence in this simple array example is 6 .
Is there a quick way to get it ? i am more concerned about SPEED as my array can be thousands of rows. Is there a binary function i can use or an array existing function i can use?
I have a 2 D array and i need to look the last occurrence of a string in one of column of that 2 d array. please note this column is sorted.
array(1,1) = 3
array(2,1)= 3
array(3,1)= 5
array(4,1)= 5
array(5,1)= 5
array(6,1)= 5
array(7,1)= 7
array(8,1)= 7
i am doing a loop in that array and when at row 3, i get [5] as value. How can i quickly get the last occurrence index of [5] without doing another loop ?
The last occurrence in this simple array example is 6 .
Is there a quick way to get it ? i am more concerned about SPEED as my array can be thousands of rows. Is there a binary function i can use or an array existing function i can use?