i have the code (java) i want the answers
Task 1 (NN Queens problem): 100% An NP-complete problem is a fascinating kind of problem because till now no one has discovered the polynomialtime algorithm to solve it and also no one has proved that no polynomial-time algorithm can exist for any NPcomplete problem. It is an open research problem since it was first posed in 1971 to prove P=NP. The NN Queens problem can be summarized as follows: putting N chess queens on an NN chessboard such that none of them is able to attack any other queen using the standard chess queen's moves (row-columndiagonal). Thus, a solution requires that no two queens share the same row, column, or diagonal. Solutions exist only for N=1 or N4. Use the given function (isQueenSafe) below to test whether a queen is attacked by another or not. You are not allowed to use any other code to check if a queen is safe. Implement a backtracking solution for the algorithm in Java that finds all possible solutions for N queens and measure the execution time it takes for N=4 to 12 and compare them according to the time and the number of solutions. Discuss whether the timing results correspond to any time complexity model. You should also complete the implementation to print the output of the recursive method, public static void solve(int k ), that takes only 1 integer k (in the main method pass the value 0 which is the first row of the board). The base condition of the recursive method is when k=N. When a queen is positioned in a row and it is safe then you call the method with the next column (k+1). Also use a static counter for the number of solutions. The output should be sinilar to the following and time should be in milliseconds (adherence to the output is required and penalty is incurred if different output is given). Store all times and the number of solutions for all values of N in a table and use in your justification in the discussion. liscussion 1) Compare the different N (number of queens) in the table above according to the time and the number of solutions. 2) Discuss the time execution complexity analysis and whether the results correspond to any complexity model? (calculate time complexity if it is possible) 3) Discuss the class of algorithmic complexity of the NxN Queens and give justification