北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】

Assignment 2 COMP9021, Term 2, 2021 1. General matter
時間: 2021-08-10 08:55:40

1.1. Aims. The purpose of the assignment is to: ? design and implement an interface based on the desired behaviour of an application program; ? practice the use of Python syntax; ? develop problem solving skills. 1.2. Submission. Your program will be stored in a file named sudoku.py. After you have developed and tested your program, upload it using Ed (unless you worked directly in Ed). Assignments can be submitted more than once; the last version is marked. Your assignment is due by August 9, 10:00am. 1.3. Assessment. The assignment is worth 13 marks. It is going to be tested against a number of input files. For each test, the automarking script will let your program run for 30 seconds. Late assignments will be penalised: the mark for a late submission will be the minimum of the awarded mark and 13 minus the number of full and partial days that have elapsed from the due date. The outputs of your programs should be exactly as indicated. 1.4. Reminder on plagiarism policy. You are permitted, indeed encouraged, to discuss ways to solve the assignment with other people. Such discussions must be in terms of algorithms, not code. But you must implement the solution on your own. Submissions are routinely scanned for similarities that occur when students copy and modify other people’s work, or work very closely together on a single implementation. Severe penalties apply. 1 2 2. Background A sudoku grid consists of 9 lines and 9 columns, making up 81 cells, that are grouped in nine 3x3 boxes. In a sudoku puzzle, some but not all of the cells already contain digits between 1 and 9. Here is an example of a sudoku puzzle. 1 9 8 6 8 5 3 7 6 1 3 4 9 5 4 1 4 2 5 7 9 1 8 4 7 7 9 2 Solving a sudoku puzzle means completing the grid so that each digit from 1 to 9 occurs once and only once in every row, once and only one in every column, and once and only once in every box. For instance, the previous puzzle has the following solution. 3 3 4 1 9 2 7 5 6 8 6 9 2 1 8 5 7 3 4 8 5 7 4 6 3 1 9 2 1 3 4 2 9 6 8 7 5 2 7 8 5 3 4 6 1 9 5 6 9 7 1 8 4 2 3 4 2 5 3 7 1 9 8 6 9 1 6 8 4 2 3 5 7 7 8 3 6 5 9 2 4 1 Solving a sudoku puzzle is a very common assignment; it is not difficult and moderately interesting as a “solution” (the completed grid) tells nothing about how the solution was reached. More interesting solvers are logical in the sense that they (possibly partially only) solve the puzzle in steps and at every step, explain how they made some progress; they do so by using some of the well known techniques that most people who solve sudoku puzzles apply. Two remarks are in order. ? Methods that only discover digits in empty cells are fairly limited; most methods need to keep track of the list of possible digits that can go into a given cell, and making progress might mean reducing that list. To apply techniques of the second kind, it is necessary to first mark the grid. ? Often, it is not possible to completely solve a puzzle using exclusively the chosen methods; at some point no progress can be made and then a random guess has to be made to either put a digit into a given empty cell, or to remove a digit from the list of possible digits that can go into a given cell. It might subsequently be necessary to backtrack and make alternative guesses if the earlier guesses turn out to be inconsistent with a solution. For this assignment, you will have to implement two such techniques, based on the notions of forced digits and preemptive sets described in the paper A Pencil-and-Paper Algorithm for Solving Sudoku Puzzles by J. F. Crook, Notices of the AMS, 56(4), pp. 460–468. Before anything else, you should study this paper. The forced digits technique is applied first, followed by the preemptive set technique. When no progress can be made, the forced digits techniques could be applied again, but that might not yield anything; an alternative would be to try and fill some empty cell with one of the possible digits for that cell and apply the preemptive set technique applied again, knowing that that guess might prove wrong and that other possible digits might have to be used instead. In this assignment, we will stop at the point where the preemptive set technique can no longer be applied; hence we can expect that our implementation will only partially solve most puzzles. But the technique is very powerful and as explained in the article, subsumes many of the well known techniques. You will design and implement a program that will read a sudoku grid whose representation is stored in a file filename.txt and create a Sudoku object, with a number of methods: 4 ? a method preassess() that prints out to standard output whether the representation is correct and has no digit that occurs twice on the same row, on the same column or in the same box; ? a method bare_tex_output() that outputs some Latex code to a file, filename_bare.tex, that can be compiled by pdflatex to produce a pictorial representation of the grid; ? a method forced_tex_output() that outputs some Latex code to a file, filename_forced.tex, that can be compiled by pdflatex to produce a pictorial representation of the grid to which the forced digits technique has been applied; ? a method marked_tex_output() that outputs some Latex code to a file, filename_marked.tex, that can be compiled by pdflatex to produce a pictorial representation of the grid to which the forced digits technique has been applied and that has been marked; ? a method worked_tex_output() that outputs some Latex code to a file, filename_worked.tex, that can be compiled by pdflatex to produce a pictorial representation of the grid to which the forced digits technique has been applied, that has been marked, and to which the preemptive set technique has been applied. The input is expected to consist of 9 lines of digits, with possibly lines consisting of spaces only that will be ignored and with possibly spaces anywhere on the lines with digits. If the input is incorrect, that is, does not satisfy the conditions just spelled out, then the program should generate a SudokuError with Incorrect input as message. Here is a possible interaction: $ python3 ... >>> from sudoku import * >>> Sudoku('sudoku_wrong_1.txt') ... sudoku.SudokuError: Incorrect input >>> Sudoku('sudoku_wrong_2.txt') ... sudoku.SudokuError: Incorrect input >>> Sudoku('sudoku_wrong_3.txt') ... sudoku.SudokuError: Incorrect input

COMP9319 2021T2 Assignment 2: Searching & Decoding BWT Encoded File
時間: 2021-07-27 07:53:40

北美代写,Homework代写,Essay代寫-准时✔️高质✔最【靠谱】Your task in this assignment is to create a simple search program that implements BWT backward search, which can efficiently search a BWT encoded file. The program also has the capability to decode the BWT encoded file back to its original file in a lossless manner. The original file (before BWT) contains text in multiple lines and may include characters with ASCII values 10 and 32 to 126 (inclusively). There will be at least one newline character just before the end of file (to make sure that every line of text is ended with a newline character). Each line begins with a line number. All line numbers of a file have the same number of digits (packed with leading zeros as appropriate). Sample input files (BWT encoded) have been provided in the folder ~cs9319/a2. To help in testing your program, the corresponding original files (after reverse BWT) are also included in that folder. These original files will not be available when we test your submission. Although you do not need to submit a BWT encoder, it is recommended that you will implement a simple BWT encoding program (this will help you in understanding the lecture materials and assist in testing your assignment). Your C/C++ program, called bwtsearch, accepts an optional flag; the path to a BWT encoded file; the path to an index file; and one quoted, non-empty query string as commandline input arguments. Using the given query string, it will perform a backward search on the given BWT encoded file and output all the lines that contain the input query string to the standard output. The search results are sorted according to their line numbers in ascending order. You may assume that the query string does not contain any newline characters. Since each line is ended with a newline character, your output will naturally be displayed as one line (ending with a '\n') for each match. No line will be output more than once, i.e., if there are multiple matches in one line, that line will only be output once. If an optional flag -m is specified, given a query string, bwtsearch will output the total number of matching substrings (count duplicates) to the standard output. The output is the total number, with an ending newline character. Similarly, bwtsearch will output the total number of unique matching records (do not count duplicates) if -n is specified. If -o is specified, no query string is required in the commandline. Instead, a output filename needs to be specified, a reverse BWT is performed and the original file (before BWT) is output (created, or overwritten if already exists) to the specified output file. Your solution can write out one external index file at any time that is no larger than half of the size of the given input BWT file, plus an extra 2048 bytes. If your index file is larger than half of the size of the input BWT file plus 2048 bytes, you will receive zero points for the tests that use that file. You may assume that the index file will not be deleted during all the tests for a given BWT file, and all the test BWT files are uniquely named. Therefore, to save time, you only need to generate the index file when it does not exist yet. 7/27/2021 COMP9319 2021T2 Assignment 2 http://www.cse.unsw.edu.au/~wong/cs9319-21a2.html 2/6 Example Consider one of the given sample files tiny.bwt. You can find the file by logging into CSE machines and going to folder ~cs9319/a2. The original file (tiny.txt) before BWT is also provided in that folder. The following are some examples using tiny.bwt. %wagner> bwtsearch -m ~cs9319/a2/tiny.bwt ./tiny.idx "ana" 2 %wagner> bwtsearch -n ~cs9319/a2/tiny.bwt ./tiny.idx "ana" 1 %wagner> bwtsearch ~cs9319/a2/tiny.bwt ./tiny.idx "ana" 01 banana %wagner> bwtsearch -m ~cs9319/a2/tiny.bwt ./tiny.idx "erry" 3 %wagner> bwtsearch -n ~cs9319/a2/tiny.bwt ./tiny.idx "erry" 3 %wagner> bwtsearch ~cs9319/a2/tiny.bwt ./tiny.idx "erry" 10 raspberry 11 cherry 13 blackberry %wagner> bwtsearch -o ~cs9319/a2/tiny.bwt ./tiny.idx tiny.decoded.txt %wagner> diff ~cs9319/a2/tiny.txt tiny.decoded.txt %wagner> More examples: %wagner> bwtsearch -n ~cs9319/a2/6MB.bwt ./6MB.idx "compilers" 1 %wagner> bwtsearch -m ~cs9319/a2/6MB.bwt ./6MB.idx "compilers" 1 %wagner> bwtsearch -m ~cs9319/a2/6MB.bwt ./6MB.idx "compiler" 8 %wagner> bwtsearch -n ~cs9319/a2/6MB.bwt ./6MB.idx "compiler" 8 %wagner> bwtsearch ~cs9319/a2/6MB.bwt ./6MB.idx "compiler" 020266 Verification of the C0 compiler implementation on the source code level. 021834 A framework for intelligent speculative compiler optimizations and its application to memory accesses. 035239 A compiler backend for generic programming with arrays. 044877 C compiler aided design of application specific instruction set processors using the machine description language LISA. 052175 Semantics-directed generation of compilers and abstract machines 123034 Evaluating compiler technology for control-flow optimizations for multimedia extension architectures. 123777 Design and implementation of a queue compiler. 125902 Hardware-compiler co-design for adjustable data power savings. %wagner> %wagner> bwtsearch ~cs9319/a2/sherlock.bwt ./SL.index ",000 pounds" 002001 the stake will be some 30,000 pounds; and for you, Jones, it will 004503 of some 14,000 pounds, which lay to his credit at the bank." 7/27/2021 COMP9319 2021T2 Assignment 2 http://www.cse.unsw.edu.au/~wong/cs9319-21a2.html 3/6 010537 50,000 pounds at once. I could, of course, borrow so trifling a %wagner> bwtsearch -m ~cs9319/a2/sherlock.bwt ./SL.index ",000 pounds" 3 %wagner> bwtsearch -n ~cs9319/a2/sherlock.bwt ./SL.index ",000 pounds" 3 %wagner> We will use the make command below to compile your solution. Please provide a makefile

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
墨尔本assignment代写,代写毕业论文,paper代写-51作业君 北美代写,程序代做,程序代写,java代写,python代写,c++代写,c代写 英国代写paper,python代写,Report代写,编程代写-程序代写网 北美代写essay,程序代写,Java代写代做,Java代考-焦点论文 澳大利亚essay代写,编程代写,代码代写,程序代写-三洋编程 加拿大essay代写|程序代写代做||Python代写|Matlab代写-Meeloun 澳大利亚代写,代写essay,代写毕业论文,留学生代写-小马代写 日本代写,北美作业代写,新加坡代写,essay代写-无时差服务 加拿大代写,作业代写,exam代考,Report代写,代写文章-最靠谱最低价 新加坡代写,北美CS代写,python代写,CS编程代写-新顾客立减20%