Count permutations of all integers upto N that can form an acyclic graph based on given conditions | Java implementation of the above approach ; Find the count of possible graphs ; Driver Code
import java . util . * ; class GFG { static void possibleAcyclicGraph ( int N ) { System . out . print ( ( int ) Math . pow ( 2 , N - 1 ) ) ; return ; } public static void main ( String [ ] args ) { int N = 4 ; possibleAcyclicGraph ( N ) ; } }