COIS 2020H S61 2015 Assignment 2.
As with assignment 1, your assignment should be completed in C# using visual studio
You should zip up your assignment files (feel free to give me the full solution directories) into your username.zip (or rar) and submit on blackboard.
1. A) Create a doubly linked list and populate it with 100 elements. These elements represent NPC’s in a game, they should have an ID and a position (x, y). They exist in a grid that is 32×32 (0,0 to 31, 31), and they should be generated at a random location. The ‘player’ should start at position 15,15. Run your program in a loop. Every iteration through the loop the player moves one unit in any direction, and the NPC’s move one unit in any direction. Take into account walls etc.
B) At each iteration find all the elements within a distance of 10 of the player. Time how long this takes.
C) At each iteration of the list sort it based on the distance from the player (you can either make a new list each time, or do an in place sort), then read in all of the elements within a distance of 10 from the player.
D) Which is faster B or C? Which scales better/worse, with more elements or an increasing grid size? It’s up to you to decide how many iterations and how much testing you want to do to answer these questions.
2. A) Write a recursive function that reverses the order of a doubly linked list (you can use the same doubly linked list from Question 1, and the text has source code for a doubly linked list).
B) Load up two doubly linked lists with 200 million identical small integer elements (say 0 – 15). Calculate the sum. Compare the timing for treating one list as a stack, and the other as a queue. (Destroy each element as you process it; that’s why you need two lists).
3. A) Create a Binary tree with 20 million elements. It should be (nearly) complete and balanced.
B) Traverse the tree in inorder using recursion, time it.
C) Traverse the tree using breadth first (which is not in order), time it.
D) Compare the timing of B and C.
Our Service Charter
Excellent Quality / 100% Plagiarism-FreeWe employ a number of measures to ensure top quality essays. The papers go through a system of quality control prior to delivery. We run plagiarism checks on each paper to ensure that they will be 100% plagiarism-free. So, only clean copies hit customers’ emails. We also never resell the papers completed by our writers. So, once it is checked using a plagiarism checker, the paper will be unique. Speaking of the academic writing standards, we will stick to the assignment brief given by the customer and assign the perfect writer. By saying “the perfect writer” we mean the one having an academic degree in the customer’s study field and positive feedback from other customers.
Free RevisionsWe keep the quality bar of all papers high. But in case you need some extra brilliance to the paper, here’s what to do. First of all, you can choose a top writer. It means that we will assign an expert with a degree in your subject. And secondly, you can rely on our editing services. Our editors will revise your papers, checking whether or not they comply with high standards of academic writing. In addition, editing entails adjusting content if it’s off the topic, adding more sources, refining the language style, and making sure the referencing style is followed.
Confidentiality / 100% No DisclosureWe make sure that clients’ personal data remains confidential and is not exploited for any purposes beyond those related to our services. We only ask you to provide us with the information that is required to produce the paper according to your writing needs. Please note that the payment info is protected as well. Feel free to refer to the support team for more information about our payment methods. The fact that you used our service is kept secret due to the advanced security standards. So, you can be sure that no one will find out that you got a paper from our writing service.
Money Back GuaranteeIf the writer doesn’t address all the questions on your assignment brief or the delivered paper appears to be off the topic, you can ask for a refund. Or, if it is applicable, you can opt in for free revision within 14-30 days, depending on your paper’s length. The revision or refund request should be sent within 14 days after delivery. The customer gets 100% money-back in case they haven't downloaded the paper. All approved refunds will be returned to the customer’s credit card or Bonus Balance in a form of store credit. Take a note that we will send an extra compensation if the customers goes with a store credit.
24/7 Customer SupportWe have a support team working 24/7 ready to give your issue concerning the order their immediate attention. If you have any questions about the ordering process, communication with the writer, payment options, feel free to join live chat. Be sure to get a fast response. They can also give you the exact price quote, taking into account the timing, desired academic level of the paper, and the number of pages.