Computer Science  >  QUESTIONS & ANSWERS  >  Wilfrid Laurier University - CP 164Deque_doublylinked (All)

Wilfrid Laurier University - CP 164Deque_doublylinked

Document Content and Description Below

""" ------------------------------------------------------- Implementation of Deque ADT using doubly-linked list ------------------------------------------------------- Authors: David Brown and Ma ... soomeh Rudafshani IDs: 999999999 and 123456789 Emails: [email protected] and [email protected] Section: CP164OC ------------------------------------------------------- """ # pylint: disable=W0212 # Imports from copy import deepcopy class DNode: def __init__(self, element): """ ------------------------------------------------------- Initializes a Deque node. Use: node = DNode(value, _prev, _next) ------------------------------------------------------- Parameters: _data - data value for node (?) _prev - pointer to another Deque node (DNode) _next - pointer to another Deque node (DNode) Returns: a new DNode object (DNode) ------------------------------------------------------- """ self._data = deepcopy(element) self._prev = None self._next = None class Deque: def __init__(self): """ ------------------------------------------------------- Initializes an empty Deque. Use: deque = Deque() ------------------------------------------------------- Returns: a new Deque object (Deque) ------------------------------------------------------- """ self._front = None self._rear = None self._count = 0 def isEmpty(self): """ ------------------------------------------------------- Determines if the Deque is empty. Use: b = deque.isEmpty() ------------------------------------------------------- Returns: True if the deque is empty, False otherwise. ------------------------------------------------------- """ if self._count == 0: b = True else: b = False return b #your code goes here def size(self): """ ------------------------------------------------------- Determines the size of Deque. Use: b = deque.size() ------------------------------------------------------- Returns: the number of data elements in the deque ------------------------------------------------------- """ return self._count [Show More]

Last updated: 3 years ago

Preview 1 out of 5 pages

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)
Preview image of Wilfrid Laurier University - CP 164Deque_doublylinked document

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Reviews( 0 )

$7.00

Buy Now

We Accept:

Payment methods accepted on Scholarfriends (We Accept)

Instant download

Can't find what you want? Try our AI powered Search

109
0

Document information


Connected school, study & course


About the document


Uploaded On

Apr 21, 2021

Number of pages

5

Written in

All

Seller


Profile illustration for Expert Tutor
Expert Tutor

Member since 4 years

58 Documents Sold

Reviews Received
6
2
0
0
3
Additional information

This document has been written for:

Uploaded

Apr 21, 2021

Downloads

 0

Views

 109

Document Keyword Tags


$7.00
What is Scholarfriends

Scholarfriends.com Online Platform by Browsegrades Inc. 651N South Broad St, Middletown DE. United States.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·