Finding the right most occurence of an element in a sorted array
Given an array of sorted numbers, we have to find the right most occurrence of a number.For example given an array {1,2,2,2,3}, the right most occurrence of 2 is at index 3 (0-based index). This post is related to one of my previous posts ( Finding the left most occurrence in sorted array).Similar to the…