Minimum operations of the given type required to make a complete graph | C ++ implementation of the approach ; Function to return the minimum number of steps required ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minOperations ( int N ) { double x = log2 ( N ) ; int ans = ceil ( x ) ; return ans ; } int main ( ) { int N = 10 ; cout << minOperations ( N ) ; return 0 ; }