Essay Analysis

    Introduction: Alice is our client and she wants to organize her daily “to-do” list. Alice wants to use two Calendars: Google Calendar to organize for personal meetings and events and Outlook Calendar to organize her professional meetings and events. The conceptual picture of a small heap for the event is shown below, for example, on Google Calendar. She will have similar heap maintained on Outlook Calendar. Fig 1: Conceptual picture of a heap If you look at the above heap, then you can see it’s a min heap. Each node is represented by event date and time. The event which starts earliest is at the root of the tree. As the property of heap, the event that is stored at each node starts earlier or at the same time to the events of its children. You will use an array to represent a heap using an array. The array representation for the above heap looks something like this: Fig 2: Conceptual array representation of the heap shown above Note: I have not filled any fields (title, attendees, location and notes) on the node. Your program however needs to value on all these fields. Implementation Requirement: 1. Priority Queue operations The priority heap needs to support the following operations: • enqueue: This operation inserts the following event (or meeting) information: o date o time o title of the meeting o attendee name o location of the meeting o any other additional notes about the meeting The event needs to be inserted in either Google Calendar or Outlook Calendar, but not to both. After each insertion, you need to make sure that the heap property is maintained. On each of the Calendar, you can only have one meeting at any time. • extractMin: This operation extracts the earliest upcoming meeting (or event) from the specified Calendar. That meeting information is displayed on the screen and the meeting is removed from the corresponding heap. After the meeting has been removed from the corresponding heap, you need to ensure the heap property. • peek: This operation just displays the earliest upcoming meeting (or event) from the specified Calendar without removing it from the specified Calendar. • merge: This operation creates a new heap that is a logical union of the two original heaps that are represent Google Calendar and Outlook Calendar. After performing the merge operation, you need to ensure the heap property. A very important point during the merge is that Alice can have two meetings (one on Google Calendar and another on Outlook Calendar) specified at the same duration. So, when merging your merged heap need to combine both of the meeting details on the same date and time. For example, if the root node on the Google Calendar has the event information as:  Data: 09/09/2021  Time: 08:00 – 08:30  Title: Doctor’s Appointment for Dog  Attendees: null  Location: 900 S Perkins Rd, Stillwater, OK 74074  Notes: null Similarly, the root node on the Outlook Calendar has the event information as:  Data: 09/09/2021  Time: 08:00 – 08:30  Title: CS3353_Meeting with Student  Attendees: James Smith  Location: Online (zoom)  Notes: Discussion on academic progress Now, when these two heaps are combined, the root of the merged heap need to contain both of this information. You cannot select one event as root and keep another event as its child. When the extract or peak operation is selected on this merged heap, it should display both of these events. • print: This operation prints all the events present on the selected heap. The user can select any of the heap i.e. either Google Calendar or Outlook Calendar or a merged Calendar. Note: Fig 2, shown above, is just a conceptual representation. Based on the programming requirement, you should design the array accordingly. 2. Array requirement In this assignment, you are going to use a dynamic array using growth strategy (please refer to lecture on chapter07 for detail). This strategy will be used for all the arrays in the program. 3. Implementation Performance Calculate the worst-case complexity of each of these operationsin your code. Make sure you show all the intermediate steps to derive to the final result. When properly implemented, the operations peek takes O(1) time, enqueue and extractMin each should take O(log n), merge completes in O(n) time and print in O(n) time. Mention, if there is any variation in the performance of your program with reason. For Bonus Point: [25 Marks] Before you proceed with the bonus part, under the grading policy on the bonus part. For the bonus part, you need to use dynamic array using tight strategy (please refer to lecture on chapter07 for detail) and measure the performance difference between this strategy and growth strategy for enqueue operation. To measure the performance difference, you need to 1. run the program and measure the time difference it takes to add N number of events, where N should be 100, 200 and 500. • To read this huge number of input, you might read all the data from the file. 2. consider the effect of growth factor i.e. constant “c” in the tight strategy (refer to the lecture video) • Consider the value of “c” as 10 and 20. • For each value of “c”, you have to consider different number of inputs (i.e. N = 100, 200 and 500). 3. perform and compare the worst-case analysis. Comment if there is any difference in the worstcase complexity. Note: You should learn how to generate arbitrary number of data required to test your program. Excel would be a good starting place for that. Grading Rubric: Your assignment will be graded based on the following grading Rubrics: • Successful implementation of enqueue operation [20 Marks] • Successful implementation of extractMin operation [20 Marks] • Successful implementation of peek operation [5 Marks] • Successful implementation of merge operation [25 Marks] • Successful implementation of print operation [10 Marks] • Use of dynamic array using growth strategy [10 Marks] • Calculation of worst-case complexity [5 * 2 Marks] Grading Policy for bonus part: The marks you obtained from completing the bonus point will only be added to the assignment portion in the final grading. For example, if a student scores 500 points (out of maximum 500 points possible for assignment), then any additional point obtained from the bonus will not be added to the grade book. The purpose of having bonus part in the assignment is not to substitute the grade of exams or discussion. However, if a student has not scored good grade in one of the 5 assignments, then completing the bonus part will help to boost the grade. The bonus will be graded based on the following grading Rubrics: • Successful implementation of tight strategy [10 Marks] • Calculation of worst-case complexity [4 Marks] • Generation of data [2 Marks] • Comparison of run time performance for different values of constant “c” i.e. The growth factor and for different growth factor, you need to consider different number of inputs (N = 100, 200 and 500 events). [9 Marks] Submission Guidelines: • In addition to .java file, all the codes should be submitted in .pdf format as well. o Name the .pdf file with the same name as that of your source code. o Please copy the codes in the text form. Do not screenshot or include any image of the code in the pdf. This is to check for plagiarism. o If you perform the bonus part, make sure to include the input data file that contains events information. • Run time analysis should be performed in a separate file and name the file as algorithmAnalysis.pdf • You need to include readMe.txt file that shows how to run your program. Make sure the program runs in csx machine. • Take a screen shot of all your outputs and save it as .pdf file. o Name this file as screenshot.pdf • The main driver file needs to have the following header information: o Author Name: o Email: <Use only official email address> o Date: o Program Description: • Use comments throughout your program. o Each class and the method should be properly commented:  description of arguments and return data  description of method • All the files should be submitted through Canvas. Assignment submitted through email will not be accepted. Additional tips to avoid any point deduction: • Failure to follow standard programming practices will lead to points deduction, even if the program is running correctly, like o No comments on code o Not writing meaningful identifiers • If the program is not compiling successfully, then 20 points will be automatically deducted. • If you use PriorityQueue class from Collections framework, then you will end up getting zero for the assignment.

IS IT YOUR FIRST TIME HERE? WELCOME

USE COUPON "11OFF" AND GET 11% OFF YOUR ORDERS