Number of edges in a perfect binary tree with N levels | Function to return the count of edges in an n - level perfect binary tree ; Driver code
def cntEdges ( n ) : NEW_LINE INDENT edges = 2 ** n - 2 ; NEW_LINE return edges ; NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n = 4 ; NEW_LINE print ( cntEdges ( n ) ) ; NEW_LINE DEDENT