EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Java代写
您的位置: 主页 > 编程案例 > Java代写 >
代写Java:留学生homework编程JAVA作业英文题目:CS 112 Fall, 2017{ Homework Four - Java代写
发布时间:2021-07-25 09:56:18浏览次数:
CS 112 Fall, 2017{ Homework FourDue October 25th at 11:59pm using gSubmitNo late assignments will be accepted.0PartAFor each function f from the following list of functions, determine which g makes f(n) is O(g(n)) true1The point of representing a function in this form is to create the simplest possible function g(n), e.g., do not include a coe cient in g(n), since it does not matter. Represent your answer as an equality (e.g., p(n) = O(n2)). To be clear, the correct answer to the rst function is shown. Write your solutions in a text le hw4.txt.1. (a) a(n) = 8n + 3 = O(n)(b)b(n) = 12n + n2+ 64(c)c(n) = 2log(n) + n(d)d(n) = log(n) + 2 p(e)e(n) = 2n2.Using O(::::) notation, determine the number of times the count() function is called when the following code fragment runs, in terms of the variable n.for (int i = 0; i i++) for (int j = 0; j j++)for (int k = 0; k k++) count();Include a short explanation of your answer by explaining how many times each loop iterates.3.Using O(::::) notation, determine the number of times the count() function is called when the following code fragment runs, in terms of the variable n.for (int i = n; i i /= 2) for (int j = 0; j j++)for (int k = 0; k 1000; k++) count();Include a short explanation of your answer by explaining how many times each loop iterates.In lecture using Wolfram Alpha, we saw that f(n) is O(g(n)) when:f(n) C g(n) k nwhere C and k are some constants. 1 4.Perform this code for insertion sort on the following input array, showing the array after every swap. public static void insertion(int[] arr) { for (int i = 1; i arr.length; i++) { for (int j = i; j j ) {if (arr[j] arr[j 1]) swap(arr, j, j 1); // show array here}}}Execute the algorithm on the following input:+ -+ | 3 | 5 | 8 | 2 | 1 | + -+5.Perform selection sort on the following input array, showing the array after each swap.public static void selection(int[] arr) { int k;for (int i = 0; i arr.length; i++) { k = i;for (int j = i + 1; j arr.length; j++) { if (arr[j] arr[k])k = j;}swap(arr, i, k); // show array here}}Execute the algorithm on the following input:+ -+ | 9 | 6 | 4 | 2 | 3 | + -+6.Now perform merge sort on the following input array, showing each subarray after it is merged with another subarray (you will sort all sublists of size 1, then of size 2, and nally of size 4).+ -+ | 9 | 5 | 3 | 2 | 1 | 8 | 7 | 4 | + -+0PartBWe have provided you on Blackboard the following Java les for PartB of this assignment:FindSpacing.javaFindSpacingDriver.java HW4IO.javaWordGame.javaWordGameDriver.javaYou are required to write code only in FindSpacing.java, HW4IO.java and WordGame.java. The le HW4IO.java is used by Word Game and Find Spacing. Inside your Eclipse, you must have the following arrangement of les inside your hw4 package before writing any code:Figure 1: Arrangement of hw4 les inside hw4 package2.1Word GameWe provide you with code for implementing the following game: given a rectangle of letters, nd all dictionary words that consist of consecutive letters on the board (up-down, down-up, left-right, or right-left). We provide a dictionary le (999 most common American English words) and a sample input, as dictionary.txt and board.txt les. We also provide a correct output for this input as example-output.txt le. Implement the code according to instructions. Don t neglect to answer one question in the comments of the code. Your submitted code should not have any new or modi ed print statements (they are useful for debugging, but remove them once you are done). You can change WordGameDriver however you want (including adding print statements); we won t grade it.If you are feeling ambitious, you can download other dictionaries { for example, the huge (178,690 words) https://www.wordgamedictionary.com/twl06/download/twl06.txt used for Scrabble. That way your program will nd more words. However, please don t submit huge dictionaries with your assignment.Note: We have provided you with lots of comments in the code to help you get started. All methods that have a TODO as part of comments, are methods that you MUST complete. Do not change the method signature or the name of the class in any way. This will break our tests and will result in you getting 0 for this question.2.2Find SpacingMany writing systems do not put a space between words (which makes translating ancient texts|such as the Bible|even more challenging). Your job is to implement a method that takes a string of letters and breaks it up into dictionary words in all possible ways. We will reuse the dictionary le of 999 most common American English words. Again, if you are feeling ambitious, you can download other dictionaries { for example, the huge (178,690 words) https://www.wordgamedictionary.com/twl06/download/twl06.txtused for Scrabble, which will make playing with your program more fun.Note: We have provided you with lots of comments in the code to help you get started. All methods that have a TODO as part of comments, are methods that you MUST complete. Do not change the method signature or the name of the class in any way. This will break our tests and will result in you getting 0 for this question. 0Submission Checklist2Similar to your previous assignments, you will create a new package hw4 in Eclipse. Inside this package, all your Java les will reside. You will only submit the package hw4 to us. This package must contain the following les only.hw4.txtFindSpacing.java HW4IO.javaWordGame.javaThe rst line in every Java le must be package hw4;Be sure to do the following:You have read the Java Style Guide for CS112 (linked on BlackBoard), and followed all guidelines regarding format, layout, spaces, blank lines, and comments;You have removed or changed all comments inherited from my templates which do not relate to your solution;You have veri ed that your program satisfy all the performance tests in the templates.You can con rm that your assignment has been correctly3submitted by typing this out: gsubmit cs112 -lsYou can add as many helper methods (these must all be private), however, YOU CANNOT CHANGETHE METHOD NAMES OR CHANGE THE SIGNATURE OF THE REQUIRED METHODS IN THISASSIGNMENT. THIS WILL BREAK OUR TESTS AND YOU WILL RECEIVE ZERO.2If you deviate from these instructions, we will penalize you 30% on the entire assignment. No late work will be accepted. If you are still not familiar with gSubmit, please stop by our o ce hours and we can help you with this. 3You can read more about the gsubmit command by typing man gsubmit on the linux machines at BU

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。