Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedall coding is on python

def 4. Create a class Deque and implement the functions of double ended queue. All functions should run in O(1). a. Write a function InsertFront that inserts an element at the front of the Deque. b. Write a function GetFront that returns the front item from the Deque. c. Write a function DeleteFront that removes an item from the front of Deque. class Deque : init__(self): 17 your code goes here def InsertFront (self, value): // your code goes here def GetFront (self): // your code goes here def DeleteFront (self): // your code goes here 5. Create a class DList and add the following functions. All functions should run in O(n). a. Write a function Insert that takes an argument x. Where x is an integer value. The function should insert the value x in a sorted doubly linked list. You have to make sure that the list should remain sorted after inserting the value of x. b. Write a function Is Sorted that checks if the doubly Linked List is sorted or not. The function should return True if the List is sorted otherwise it should return false. c. Write a function DeleteDuplicates that deletes duplicate values from the linked list. The function should return a sorted list after deleting the duplicate values. class DNode: def _init__(self, value): self.value = value self.next = None self.previous = None class DList: def _init__(self): self.head = None self.tail = None def Insert (self,x,)): // your code goes here def IsSorted (self): 1/ your code goes here def DeleteDuplicates (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

Recommended Textbook for

Beginning C# 2005 Databases

Authors: Karli Watson

1st Edition

0470044063, 978-0470044063

More Books

Students also viewed these Databases questions

Question

2. What is the business value of security and control?

Answered: 1 week ago