Data Structures and Algorithms in Java
Data Structures and Algorithms in Java
6th Edition
ISBN: 9781118771334
Author: Michael T. Goodrich
Publisher: WILEY
Question
Book Icon
Chapter 3, Problem 33C
Program Plan Intro

Initial consideration:

While the circularly liked list implementation has to be provided using inheritance in such a way that a DoublyLinkedList class inherits from the existing CircularlyLinkedList, and the DoublyLinkedList.Node nested class inherits from CircularlyLinkedList.Node.

The following consideration has to be made before implementation:

  • A circular version of a doubly linked list has to be implemented that is not having any sentinels that can generally supports the public behaviors of the original and new update methods.
  • The implemented circular doubly linked list should have method called rotate() which is used to rotate the linked list counter clockwise and rotateBackward() method that can support the  public behaviors of the linked list.
  • There is no need to use the sentinel nodes which are more generally useful with linked list implementation that helps to maintain the reference of all nodes of a doubly linked list.
  • The node in the circular version of doubly linked list maintains two references with the previous and the next node in the doubly linked list.

Doubly-linked list:

  • Doubly-linked list is a kind of data structure in which every node in the list has two link pointers where one link is pointing to previous node and the link will point to the next node in the list.
  • The first node in the linked list generally points to a Null pointer and the next link of the last node in the linked list is pointing to the Null.

CircularlyLinkedList:

  • Circular Linked List is also a kind of data structure where all the nodes in the list are in the formed of a circular fashion.
  • The circular pattern can be a singly or doubly linked list. Unlike doubly linked list there is no Null pointer in the circular linked list. The nodes are added and removed based on the constant time factor.
  • The main advantage of circular linked list is the ability to traverse the nodes of the linked list.

Inheritance:

  • In object-oriented programming (OOP) inheritance is a procedure to create new class from an existing class which is known as base class or super class and the inherited class is known as derived class or sub class and the new class will inherits all the properties of the existing parent class.

Blurred answer
Students have asked these similar questions
What are the major threats of using the internet? How do you use it? How do children use it? How canwe secure it? Provide four references with your answer. Two of the refernces can be from an article and the other two from websites.
Assume that a string of name & surname is saved in S. The alphabetical characters in S can be in lowercase and/or uppercase letters. Name and surname are assumed to be separated by a space character and the string ends with a full stop "." character. Write an assembly language program that will copy the name to NAME in lowercase and the surname to SNAME in uppercase letters. Assume that name and/or surname cannot exceed 20 characters. The program should be general and work with every possible string with name & surname. However, you can consider the data segment definition given below in your program. .DATA S DB 'Mahmoud Obaid." NAME DB 20 DUP(?) SNAME DB 20 DUP(?) Hint: Uppercase characters are ordered between 'A' (41H) and 'Z' (5AH) and lowercase characters are ordered between 'a' (61H) and 'z' (7AH) in the in the ASCII Code table. For lowercase letters, bit 5 (d5) of the ASCII code is 1 where for uppercase letters it is 0. For example, Letter 'h' Binary ASCII 01101000 68H 'H'…
What did you find most interesting or surprising about the scientist Lavoiser?
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
CMPTR
Computer Science
ISBN:9781337681872
Author:PINARD
Publisher:Cengage