Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I couldn't upload all the files. Here is the link to the files. https://drive.google.com/open?id=19TMnLjldZWScUxH3nHZnFtE-SbyH43A4 Homework - Homework 3 Submit to Blackboard before the deadline. You
I couldn't upload all the files. Here is the link to the files.
https://drive.google.com/open?id=19TMnLjldZWScUxH3nHZnFtE-SbyH43A4
Homework - Homework 3 Submit to Blackboard before the deadline. You will be able to revise your answers until the deadline with no penalty Topics: Lists (single-linked), drawing the relevant nodes and the readjustment of links. Task 2 (10 pts.) - Time complexity For each function discussed in Task 1, specify the time complexity (in Theta notation) that can be attained for that function, using lists as defined in listhw.c. You must give the complexity of the functions that you wrote, as you wrote them. For example if your implementation is inefficient you should give the run time of your implementation (not that of some other efficient implementation). Also if your function calls a helper function that you wrote or if it calls some other already provided list function, you should take in consideration the time complexity of that function as well in your answer. Remember that the time complexity describes the worst-case behavior A brief justification is sufficient. You do NOT need to use the table method. Also note that these points will not be distributed equally per function, but given as a total. Therefore if any of the above functions requires a more complicated time analysis it will get more points than the others. Put your answer in the 2320_H3.pdf file. Task 3 (10 pts) See 2320 H3.pdf for this problem. Here is a docx version of the document, for your convenience. If you are using this, save it as a pdf when finished and submit the Task 1 (80 pts.) - Single-linked list, extend interface Summary: For this task You are given 3 files (list_hw.h, list_hw.c, and instructor_client.c). Download them, and compile and run them on omega as given. They should run fine. File list_hw.c has 5 stubs (place-holders) for functions that you will have to implement. When compiling with the original list_hw.c, it will call this functions, but they will not do anything. After you implement them, they should do what is required. You will also have to test your functions thoroughly and report the result of those tests in the 2320_ H3.pdf file Provided files: list hw.c- The function stubs (where you will write your code) are at the end. . list hw.h header file. Do not modify it. . instructor client.c client program. Do not modify it. . sample run See the expected behavior of your program and compilation instructions here .2320 H3.f l-in the written answers for all tasks in here. Required test cases for Task 1 are also here Here is a docx version of the document, for your convenience. If you are using this, save it as a pdf when finished and submit the pdf Below are given 5 functions that you must implement in list_hw.c and the requirements that your code must meet (e.g. no memory errors, keep the function signature, etc.). The list hw.c file already has stubs for these functions. You just need to go in there and put the actual code for them. 1. (15 points) list sublist(list A, list pos_list). This function returns a list that contains the values that appear in list A at positons given in pos list o Requirement 1: the values should appear in the result in the order given by pos_list. For example if A: 15- 100->7->5- 1007-30 and pos_list: 3-0> 6-> 4 The resulting list will be A[3] -> A[0]-> A[6]-> A[4], which gives values: 5->15-> 30->100 o Requirement 2: the result should be a deep copy, so that any future changes in list A cannot possibly affect the result, and any future changes in the result cannot possibly affect list A. (List A should remain as it was after building the sublist.) Homework - Homework 3 Submit to Blackboard before the deadline. You will be able to revise your answers until the deadline with no penalty Topics: Lists (single-linked), drawing the relevant nodes and the readjustment of links. Task 2 (10 pts.) - Time complexity For each function discussed in Task 1, specify the time complexity (in Theta notation) that can be attained for that function, using lists as defined in listhw.c. You must give the complexity of the functions that you wrote, as you wrote them. For example if your implementation is inefficient you should give the run time of your implementation (not that of some other efficient implementation). Also if your function calls a helper function that you wrote or if it calls some other already provided list function, you should take in consideration the time complexity of that function as well in your answer. Remember that the time complexity describes the worst-case behavior A brief justification is sufficient. You do NOT need to use the table method. Also note that these points will not be distributed equally per function, but given as a total. Therefore if any of the above functions requires a more complicated time analysis it will get more points than the others. Put your answer in the 2320_H3.pdf file. Task 3 (10 pts) See 2320 H3.pdf for this problem. Here is a docx version of the document, for your convenience. If you are using this, save it as a pdf when finished and submit the Task 1 (80 pts.) - Single-linked list, extend interface Summary: For this task You are given 3 files (list_hw.h, list_hw.c, and instructor_client.c). Download them, and compile and run them on omega as given. They should run fine. File list_hw.c has 5 stubs (place-holders) for functions that you will have to implement. When compiling with the original list_hw.c, it will call this functions, but they will not do anything. After you implement them, they should do what is required. You will also have to test your functions thoroughly and report the result of those tests in the 2320_ H3.pdf file Provided files: list hw.c- The function stubs (where you will write your code) are at the end. . list hw.h header file. Do not modify it. . instructor client.c client program. Do not modify it. . sample run See the expected behavior of your program and compilation instructions here .2320 H3.f l-in the written answers for all tasks in here. Required test cases for Task 1 are also here Here is a docx version of the document, for your convenience. If you are using this, save it as a pdf when finished and submit the pdf Below are given 5 functions that you must implement in list_hw.c and the requirements that your code must meet (e.g. no memory errors, keep the function signature, etc.). The list hw.c file already has stubs for these functions. You just need to go in there and put the actual code for them. 1. (15 points) list sublist(list A, list pos_list). This function returns a list that contains the values that appear in list A at positons given in pos list o Requirement 1: the values should appear in the result in the order given by pos_list. For example if A: 15- 100->7->5- 1007-30 and pos_list: 3-0> 6-> 4 The resulting list will be A[3] -> A[0]-> A[6]-> A[4], which gives values: 5->15-> 30->100 o Requirement 2: the result should be a deep copy, so that any future changes in list A cannot possibly affect the result, and any future changes in the result cannot possibly affect list A. (List A should remain as it was after building the sublist.)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started