Question: Take note this is in java programming.Answer the answers in java language. The following remarks apply specifically for programming questions, if any: 1. Compile and

 Take note this is in java programming.Answer the answers in java

Take note this is in java programming.Answer the answers in java language.

The following remarks apply specifically for programming questions, if any: 1. Compile and test all codes before submitting to ensure that they are error free. 2. Provide the necessary comments in your source codes. 3. Include both codes and sample outputs (e.g. screen shots) in your answer script, i.e. Word document. Additionally, attach also the original source codes (e.g. *.java files) in the final zipped file for submission. 4. Note the differences between the codes for a complete Java program and Java method. Java program comprises all codes needed for compilation and execution of a runnable system. A complete Java program can include multiple methods and method calls. Modularity makes the entire program more readable and easier to debug. You should always strive to modularize your codes. A Java method on the other hand is limited to the implementation of procedure/function performing a specific task. 5. Hence, read each question requirements properly in order to avoid loosing marks unnecessarily.

Question 4 Given a list, L of n integers, write an algorithm to delete an element at position k assuming that k n). After the deletion, there should be no gap between any elements in L except for the last. For instance: .L (1,2, 3, 4, 5,6,7), k 2 After removing the th element, the intermediate L (1,2, 4, 5, 6, 7) After clearing the gaps, the final L (1,2, 4,5, 6, 7) (a) Implement the task using i. Array data structure. 10 marks ii. Linked list data structure 10 marks TCC 236/05 (b) Determine the complexity of each of your algorithms in terms of data movement and effort to delete the element. That is, in the worst case, how many times should the data in L be moved to fill the gap? Also, how many comparisons does it take to delete the k element? Provide the big-oh notation and explain your answers 10 marks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!