Skip to content

solved#1078

Open
jeetusingh247 wants to merge 1 commit intosuper30admin:masterfrom
jeetusingh247:master
Open

solved#1078
jeetusingh247 wants to merge 1 commit intosuper30admin:masterfrom
jeetusingh247:master

Conversation

@jeetusingh247
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  1. The N-Queens solution is correct and efficient.
  2. The code is clean and well-commented.
  3. The backtracking logic is correctly implemented.

Areas for Improvement:

  1. The submission should only include the solution for the problem asked (N-Queens). The Word_Search solution is extraneous and should be removed.
  2. In the N-Queens solution, the time complexity comment is slightly inaccurate. It should be O(n!) with an additional O(n) per solution to build the output, but the overall complexity is dominated by the backtracking which is O(n!).
  3. The comment in the N-Queens solution says "Time: O(n.n! + nsqr)", which is not precise. The actual complexity is O(n!) for the backtracking, and for each solution, we do O(n^2) to build the board. So overall it is O(n! * n^2). However, since n is small (up to 9), it is acceptable.
  4. In the Word_Search solution (though not required), the comment for time complexity is O(3^l), but it should be O(3^l * m * n) because we start from every cell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants