Minimum operations of the given type required to make a complete graph | Java implementation of the approach ; Function to return the minimum number of steps required ; Driver Code
class GFG { static int minOperations ( int N ) { double x = Math . log ( N ) / Math . log ( 2 ) ; int ans = ( int ) ( Math . ceil ( x ) ) ; return ans ; } public static void main ( String [ ] args ) { int N = 10 ; System . out . println ( minOperations ( N ) ) ; } }