Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

All coding is on PYTHON . 4. Create a class Deque and implement the functions of double ended queue. All functions should run in O(l).

All coding is on PYTHON .

image text in transcribed

4. Create a class Deque and implement the functions of double ended queue. All functions should run in O(l). a. Write a function InzertRear that inserts an element at the rear of the Deque. b. Write a function GetRear that returns the last item from the Deque. c. Write a function DeleteRear that removes an item from the rear of Degue. class Degus det _init__(self): // your code goes here de Jossetosak alfwadual: // your code goes here det GetBox(self): // your code goes here det Destesak (self): 17 your code goes here 5. Create a class LinkedList and add following functions. All function should run in O(n) a. Write a function Insert that takes two arguments x and j. Where x and j are integers. The function should insert value x at position j in the linked list. b. Write a function SearchBxValue that takes an argument x. Where x is an integer. The function should search the position of the value x in the list and should return the position of the location. It should return -1 if the value is not found. c. Write a function Delete Duplicates that deletes duplicate values from the linked list. The function should return a sorted list after deleting the duplicate values. class Node: des _init__(selfwalue! : 862&adus = value 361 vext = None class biokedlist: def _i08$__(self): 861&bead = None 860vtaid - None det Insert (se): // your code goes here des Seeschbadused: 1/ your code goes here de Delete Duplicates (self): // your code goes here

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

Students also viewed these Databases questions