iven a directed graph, determine if it contains any cycles. If a cycle exists, provide one example of such a cycle. For the above graph, your program should simply output “Yes” as it contains cycles. 4. Find out the number of connected components from a NxN matrix which only contains the numbers “0” and “1”. For example, if you have a 6x6 matrix with the values, 100100 001010 000000 110000 111000 010100 This has 3 connected components. A connected component will have a 1 in any of the cells surrounding it. Your program will take input N, the size of the NxN matrix and the matrix itself. Input: 6 100100 001010 000000 110000 111000 010100 Output: 3 Input: 8 01100101 01000001 00011000 00000010 11000011 10100010 10000001 01100000 Output: 6