Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Tasks 2 and 3 used as reference. Need help with Task 4. Thank you :) Task 2 12 marks] Modify your list implementation so that

Tasks 2 and 3 used as reference. Need help with Task 4. Thank you :) image text in transcribed
Task 2 12 marks] Modify your list implementation so that the size of the underlying array is dynamic. The base size of the array is 20 and should never be less than 20. However, if the list becomes full, it is resized to be 2 times larger than the current size. Likewise, the underlying size should decrease by half if the underlying array is larger than the base size but the content occupies less than of the available space. When resizing the list, retain the contents of the list. That is, when it is initially filled, it will be resized to 20 items, then 40, while retaining the contents initially in it. The same happens when the size of the array shrinks. Task 3 12 marks] Re-do task 1, now with a Linked Structure instead of an array. Task 4 12 marks] e Implement a function that takes a filename as input and reads it into an instance of the class you implemented on Task 2. For each line in the file, store it as a single item in the list. Implement a function that takes a filename as input and reads it into an instance of the class you implemented on Task 3. For each line in the file, store it as a single item in the list. For a refresher on how to read data from a file, read the tutorial found at https://docs.python.org/ 3/tutorial/ inputoutput .html# reading-and-writing-files

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

7th edition

978-1111825911, 1111825912, 978-1133684374, 1133684378, 978-111182591

More Books

Students also viewed these Databases questions

Question

What did they do? What did they say?

Answered: 1 week ago

Question

2. Do you find change a. invigorating? b. stressful? _______

Answered: 1 week ago