Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Baseline ImplementationProvided to you is a simple implementation of the pruned backtracking search. The implementation is broken - down into three parts: ( 1 )
Baseline ImplementationProvided to you is a simple implementation of the pruned backtracking search. The implementation is brokendown into three parts: the entry point of the application ie the main function which instrument the execution of the whole application; auxiliary functions, which execute secondary functionality to print solutions; and core functions to execute the pruned backtracking algorithm. The detailed description of each part of the implementation is as follows: Entry Point of the Application: This constitute the main function of the application, shown in Figure The main function will initialize global variables used to store solutions. It will also ask the user for the value of n The main function will also allocate an n times n board bytearray on its stack and pass the address to that board to the backtracking search implementation. The main function will instrument the execution by calling solveNQueen, which executes the backtracking search implementations. Once finished with search, the main function will call printSolutions from the auxiliary functions to print all stored solutions Auxiliary Functions: There are two auxiliary functions, shown in Figure : printSolutions, and printSolution. The first auxiliary function printSolutions iterates through the global memory area for stored solutions, which is boards, and calls printSolution to print each board by passing it as an argument. The second auxiliary function printSolution prints the solution passed through arguments to stdout Core Functions: There are three functions that are used together to execute the core backtrack ing search algorithm, shown in Figure : solveNQueen, isSafePlacement, and saveSolution. The main function is solveNQueen, which recursively iterates through the rows looking for safe placement for a queen and traversing the tree, shown in Figure Safe placements for a potential queen is checked through the second function, isSafePlacement. Finally, once a safe placement is found for a queen on the last row, solveNQueen calls the third function saveSolution to save the solution in the global memory buffer boards and keep track of how many solutions were found.Deliverables and ReportThe work required for this bonus work assignment is divided into two parts: deliverables, and a report DeliverablesThere are three deliverables for this assignment. These deliverables and their explainations are as follows: Baseline Implementation in MIPS: An implementation in MIPS assembly for the baseline implementation described in Section One can focus on the implementation of the core functions only. The Ccode provided can be used as a golden reference to crosscheck results and verify correctness Alternative Implementation in C and MIPS: An implementation in C and MIPS assembly for the improved and enhanced alternative implementation of an algorithm that can solve the N Queens puzzle described in Section This alternative implementation is expected to compete and achieve better performance in solv
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started