【COMP 8042 算法求解】Put your Name & Id
on the report
Assignment2
Due April 11th, 2021 11:45pm
COMP 8042
All work should be done individually.
- (25 points) Modify the the CuckooHashTable class in the CuckooHashing.h file to implement
a cuckoo hash, as described in class and chapter 5 of the textbook. - (20 points) Complete the implementation of the GetMinDegIndex() and TopologicalSort()
functions in the Graph.h file to implement a topological sort on a graph, as covered in
class and chapter 9 of the textbook. - (55 points) Sudoku is a logic-based, combinatorial number-placement puzzle. In classic
sudoku, the objective is to fill a 9 × 9 grid with digits so that each column, each row,
and each of the nine 3 × 3 subgrids that compose the grid (also called “boxes”, “blocks”,
or “regions”) contain all of the digits from 1 to 9. The puzzle setter provides a partially
completed grid, which for a well-posed puzzle has a single solution. [Wikipedia]
The goal of this exercises is to develop a solver for a 9 × 9 sudoku puzzle using what you
have learned in chapter 10 of textbook (algorithm design techniques). For that matter,
you are allowed to think of any algorithm design technique that fits this problem. You
will need to explain what technique you have chosen and how it had helped you solve
the problem in the source code itself.
Make sure to comment each change in your code clearly so it is easy to see what you have
changed.
Also please do not change the return types of the functions and do not add any cout
calls in the 3 files you submit (you can add them while working on the solution but please
remove them before submission). - Submit the completed Graph.h, CuckooHashing.h and Sudoku.h files (along with any
other necessary file that you had to implement and use) in a single ZIP file called
A00######.zip to D2L, where A00###### is your A00 number. You do not
need to prepare a report file. You also will not need to submit COMP8042A2Test.cpp
since I will use another hidden test file which is different from this one. Make sure you
test all the corner cases for each problem. - Important grading point: if your final submission takes more than 2 minutes to run,
your submission will timeout and you will not receive a grade.
推荐阅读
- 算法题(如何从列标题中查找Excel列号())
- JavaScript如何从数组中删除最后一项()
- 如何从Python中的列表中删除多个元素(完整实现)
- 算法题(给定矩阵的所有行中的公共元素)
- 算法(给定一个单词序列,使用STL打印所有的字谜)
- 算法题(如何计算两个数组中的最大求和路径())
- 算法(将所有小于或等于k的元素组合在一起所需的最小交换)
- 蓝桥杯常考算法剖析|【蓝桥杯】最难算法没有之一· 动态规划真的这么好理解((引入))
- 操作系统中的死锁检测算法详细指南