{"id":23665803,"url":"https://github.com/b3ta-blocker/the-n-queen-problem","last_synced_at":"2025-12-08T10:30:27.222Z","repository":{"id":184896930,"uuid":"672647408","full_name":"B3TA-BLOCKER/The-N-Queen-Problem","owner":"B3TA-BLOCKER","description":" This repository contains a C++ solution to the classic N-Queens problem using recursion and backtracking. ","archived":false,"fork":false,"pushed_at":"2024-03-14T11:13:28.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-29T06:16:17.599Z","etag":null,"topics":["array-manipulations","backtracking","dynamic-memory-allocation","input-output","loops","pointer","recursion"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/B3TA-BLOCKER.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-07-30T19:36:15.000Z","updated_at":"2024-05-26T18:45:07.000Z","dependencies_parsed_at":"2024-03-14T12:29:07.655Z","dependency_job_id":"5b080f7d-bb46-4eda-9394-2eb9674e56ed","html_url":"https://github.com/B3TA-BLOCKER/The-N-Queen-Problem","commit_stats":null,"previous_names":["b3ta-blocker/n-queen","b3ta-blocker/the-n-queen-problem"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B3TA-BLOCKER%2FThe-N-Queen-Problem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B3TA-BLOCKER%2FThe-N-Queen-Problem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B3TA-BLOCKER%2FThe-N-Queen-Problem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/B3TA-BLOCKER%2FThe-N-Queen-Problem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/B3TA-BLOCKER","download_url":"https://codeload.github.com/B3TA-BLOCKER/The-N-Queen-Problem/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239665895,"owners_count":19677029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array-manipulations","backtracking","dynamic-memory-allocation","input-output","loops","pointer","recursion"],"created_at":"2024-12-29T06:16:29.695Z","updated_at":"2025-12-08T10:30:26.921Z","avatar_url":"https://github.com/B3TA-BLOCKER.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# N-Queens Solver 🧑‍💻👑\n\n## Overview\n\nThe N-Queens Solver is a C++ program that tackles the classic N-Queens problem, leveraging recursion and backtracking. This problem involves placing N queens on an N x N chessboard in such a way that no two queens threaten each other. The solution employs dynamic memory allocation for a 2D array representing the chessboard.\n\n## Code Features 🚀\n\n- **Recursion and Backtracking:** The heart of the solution lies in the recursive `N_Queen` function, exploring safe queen placements and backtracking when needed.\n\n- **Dynamic Memory Allocation:** The program dynamically allocates a 2D array (`arr`) to simulate the chessboard, ensuring efficient memory usage.\n\n- **Array Manipulation:** The `Is_Safe` function carefully examines rows, columns, and diagonals in the chessboard array (`arr`) to determine safe queen placements.\n\n- **Input/Output Handling:** Users are prompted to input the size of the chessboard (`n`), and the program outputs the resulting configuration when a solution is found.\n\n- **Pointer and Memory Management:** Pointers are used for dynamic memory allocation, and memory is deallocated at the end to prevent memory leaks.\n\n## Tech Stack 💻\n\n- **Language:** C++\n- **Concepts:** Recursion, Backtracking, Dynamic Memory Allocation\n\n## Usage 🧩\n\n1. **Compile:** Use a C++ compiler to build the executable from the provided source code.\n\n    ```bash\n    g++ main -o main.cpp\n    ```\n\n2. **Run:** Execute the compiled program.\n\n    ```bash\n    ./main\n    ```\n\n3. **Input:** Enter the desired size of the chessboard when prompted.\n\n4. **Output:** View the resulting N-Queens configuration if a solution is found.\n\n## Example Output 🎲\n\n```\nEnter the size of the chessboard: 4\n\n0   1   0   0\n\n0   0   0   1\n\n1   0   0   0\n\n0   0   1   0\n```\n\n## Contributing 🤝\n\nFeel free to contribute to this project by opening issues or submitting pull requests. Your feedback and improvements are highly appreciated.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb3ta-blocker%2Fthe-n-queen-problem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb3ta-blocker%2Fthe-n-queen-problem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb3ta-blocker%2Fthe-n-queen-problem/lists"}