Write a program with a method that takes a dlinkedlist

Assignment Help Programming Languages
Reference no: EM132468437

Assignment

Question 1. Write separate programs for the following exercises in Python. Each file should have your name at the top in comment, with short description of what is implemented in that file. Make sure your files have appropriate names as indicated in each exercise. Programs should write output to the Console and have hard coded input in main.

Part a) DLinkedList:

• Add new operation to DLinkedList called subList with single parameter for Vehicle's model. The operation should find all the vehicles with that model and return the Vehicle instances as a list object. If no vehicles are found it should return an empty list.
• Modify the code in DLinkedList so that no duplicate vehicle objects can be added based on vin value. Note: you cannot add any new class members. You can only modify existing functions and/or add new functions. When there is an attempt to add a duplicate vehicle, the operation should raise an exception with meaningful message.
• Add new operation to DLinkedList called addList with single parameter which is another DLinkedList instance. The operation should attach the parameter's list to the end of itself. If the parameter's list is None, the operation should raise an exception with meaningful message.
• Analyze in writing, explaining all calculations and final grow rate, time and space complexity of the new operations to include best, average, and worst case
• Write test program (TestDLinkedList class) which creates an instance of the DLinkedList and calls all the new operations to demonstrate they work correctly.
• Video: Explain the new operation design and implementation, show the program running, and explain output

Part b) ConvertToArray:
• Write a program with a method that takes a DLinkedList instance as a parameter and another string parameter filter. It then copies every Vehicle object in the parameter list whose vin value contains the filter value, to the array called vehicleArray.
• The method must check if the parameters are None or list is empty and raise an exception with meaningful message if it is. At the end of the method execution, the parameter list instance must remain unchanged. The method should return the vehicleArray.
• Analyze in writing, explaining all calculations and final grow rate, time and space complexity of the method to include best, average, and worst case
• Write a main method to test the code - both for valid and invalid parameters.

• Video: Explain the design and implementation of convertToArray method, show the program running, and explain output

Part c) Queue/Stack:
• Add peek operation to return the Vehicle to be deQueue(ed) next without removing it
• Add peek operation that has no parameters and returns Vehicle object that would be pop()ed but without removing
• Analyze in writing, explaining all calculations and final grow rate, time and space complexity of the peek operations to include best, average, and worst case

Part d) Queue/Stack usage: Write a program with two functions as follow:
• Method addYear takes an instance of a Queue (populated with Vehicle objects) and returns a new Stack instance where each vehicle's year was incremented by one and is in the same order as the Queue. The method can only use the
Queue/Stack's operations to access data. If parameter is None it should throw an exception. The Queue instance in the parameter should be unchanged at the end of the method.
• Method countMake takes an instance of a Stack (populated with Vehicle objects) and string value for make, returns a new Queue instance with the vehicle objects that match the make. The method can only use the Queue/Stack's operations to access data. If any parameter is None it should throw an exception. The Stack instance in the parameter should be unchanged at the end of the method.
• Write test main method to demonstrate that the above methods work correctly
• Analyze in writing, explaining all calculations and final grow rate, time and space complexity of the methods to include best, average, and worst case
• Video: Explain methods, run program and explain output.

Question 2. Stack1 (manual): A letter means doing a push operation and an asterisk means doing a pop operation n the below sequence. Manually determine and give the sequence of letters which are returned by the pop operations when this sequence of operations is performed on an initially empty stack.
AB*C**F*GH**

Question 3. Stack2 (manual): Given an empty stack in which the values A, B, C, D, E, F etc. are pushed on the stack in that order but can be popped at any time, manually determine and give a sequence of push and pop operations which results in pop()ed order of BEDCGFA

Question 4. Record a video(s) 15-25 min long going over the exercises as indicated above. You may have two separate videos if you need more time to explain all exercises. DO NOT create separate videos for each exercise!

Attachment:- Python Programming.rar

Reference no: EM132468437

Questions Cloud

What is correct amount of net income for the current year : Is this year's net income of $41 million overstated, understated, or correct? What is the correct amount of net income for the current year?
Make an argument whether or not scratch-grain : In analyzing their existing product decisions, make an argument whether or not Scratch & Grain has created value with their products, and if so
Record the december adjusting entry : Record the December 31 adjusting entry for the partial-year depreciation expense for the carpet, assuming that Willow Creek uses the straight-line method
Good job at coordinating promotional activities : What promotional tools is the company using to communicate this message and how are they integrated with one another.
Write a program with a method that takes a dlinkedlist : Write a program with a method that takes a DLinkedList instance as a parameter and another string parameter filter. It then copies every Vehicle object
Calculate the annual depreciation for the asset purchase : Calculate the annual depreciation for the asset purchase using the MACRS depreciation percentages and the asset's depreciation is already reflected in its EBIT
Calculate the firm operating cash flows : Calculate the firm's operating cash flows for each of the 6 years. Assume that the firm is subject to a 40% tax rate on all the profit that it earns.
Determine not characteristic of corporate form organization : Determine Which of the events is first when a corporation pays a dividend? Which not a characteristic of the corporate form of organization
Extension of the manufacturer own organization : Channel members viewed from the customers' perspective are an extension of the manufacturer's own organization. Do you agree or disagree? Explain.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd