Find element in a sorted array whose frequency is greater than or equal to n / 2. | C # code to find majority element in a sorted array ; Driver code
using System ; public class GFG { public static int findMajority ( int [ ] arr , int n ) { return arr [ n / 2 ] ; } public static void Main ( ) { int [ ] arr = { 1 , 2 , 2 , 3 } ; int n = arr . Length ; Console . WriteLine ( findMajority ( arr , n ) ) ; } }