Display the generated linked list items

Assignment Help Computer Engineering
Reference no: EM132173777

Using PYTHON, Consider the implementation of the Linked list class, implement the following functions as part of the class:

index(item) returns the position of item in the list. It needs the item and returns the index. Assume the item is in the list.

pop() removes and returns the last item in the list. It needs nothing and returns an item. Assume the list has at least one item.

pop(pos) removes and returns the item at position pos. It needs the position and returns the item. Assume the item is in the list.

- a function that counts the number of times an item occurs in the linked list

- a function that would delete the replicate items in the linked list (i.e. leave one occurrence only of each item in the linked list)

Your main function should do the following:

1. Generate 15 random integer numbers in the range from 1 to 5.

2. Insert each number (Item in a node) in the appropriate position in a linked list, so you will have a sorted linked list in ascending order.

3. Display the generated linked list items.

4. Call the index(item), pop() and pop(pos) functions to test them.

5. Display the linked list items

6. Display the number of occurrences of each item.

7. Delete the replicate items in the linked list (i.e. leave one occurrence only of each item in the linked list)

8. Display the final linked list items that should be unique and sorted.

Reference no: EM132173777

Questions Cloud

Write a program that prompts for an integer-lets call it : Write a program that prompts for an integer-let's call it X-and then finds the sum of X consecutive integers starting at 1.
Calculate the value of z : Assume that z is the test statistic. (Give your answers correct to two decimal places.)
Create a class called employee : Create a class called Employee. Constructor that accepts 5 parameters (for each of the attributes)
Question the accuracy of study : You read an article that states that the average male college student spends 3 hours per week playing video games.
Display the generated linked list items : Delete the replicate items in the linked list (i.e. leave one occurrence only of each item in the linked list).
Write the code for a modified game of the card game : Write the code to be a 2 player game with any 8 card being able to input a new face value to play on the discard pile.
Evidence to suggest that the men at company : Is this enough evidence to suggest that the men at our company are taller than average? Use a significance level of .01.
What is the required sample size : What is the required sample size, if the researcher wants to be accurate to within 0.5 minutes at a 95% level of confidence?
Determine the point estimate of the population proportion : Determine the point estimate of the population proportion lower bound=0.342, upper bound=0.918, n=1200

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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