answersLogoWhite

0


Best Answer

Two, but there is no "might" about it. For any node (including the head) we must update exactly two links:

node.next.prev = node.prev

node.prev.next = node.next

If the node is also the head then we also update the head node pointer:

head = node.next

Aside from deleting the head node, the only special case we need to deal with is when the node being deleted is the only node in the list because this will refer to itself (thus head = node.next would result in head pointing to a node we're about to delete). However, we can avoid this special case by using a sentinel node to represent the head of the list. In this way, every list, including an empty list, always has at least one node; the sentinel.

Note that with a circular doubly linked list there no need to keep track of the tail node given that the head node's previous node already refers to the tail. However, with a singly-linked circular list we only need to keep track of the tail node since the next node after the tail is always the head node.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: IN a circular doubly linked list with 10 nodes what is the minimum number of links that might have to be changed if we want to delete a node other than the head node?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How can implement round robin sceduler in java using circular doubly linked list?

I'm sorry brother


Which function removes last element in a list?

If you are using the doubly-linked list from the STL library, then the function call:name_of_list.push_back();should delete the last element.


Why you use doubly link list?

In a doubly linked list, you can iterate backwards as easily as forwards, as each element contains links to both the prior and the following element. You can also insert or delete an element without needing to iterate and remember the prior element's link. This comes at a cost. You are adding storage to each element for the second link, and you are adding processing overhead to the insert and delete operation. You have to determine the tradeoff.


How do you write a Java program to implement weighted queue using circular doubly linked list?

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.


What are the applications for circular linked lists?

A singly-linked circular list is useful for implementing queue data structures with minimum overhead. Normally we implement a queue with two pointers: one to the tail for insertions and one to the head for extractions. With a circular list we only need to maintain a single pointer to the tail because the tail always points "forwards" to the head (instead of null as it normally would), thus achieving constant-time access to both the head and tail via a single pointer. Circular linked lists are generally useful wherever "wraparound" is necessary. That is, from any given node in the list, we can traverse forwards with the guarantee that we will eventually arrive back at that same node. With doubly-linked circular lists we have the advantage of traversing in either direction (bi-directional traversal).

Related questions

What is the difference between doubly linked list and circular linked list?

A doubly linked list allows traversal in both directions (forward and backward) by having each node point to both its next and previous nodes. A circular linked list is a type of linked list where the last node points back to the first node, forming a circular structure. This allows continuous traversal through the elements without a definitive end.


C program to implement deque using circular linked list?

You'll need to use a doubly-linked circular list, since otherwise when you pop off the tail element you'll need to whizz all the way round the list to find its predecessor. See the links section for an implementation of a doubly-linked circular list.


How can implement round robin sceduler in java using circular doubly linked list?

I'm sorry brother


Which function removes last element in a list?

If you are using the doubly-linked list from the STL library, then the function call:name_of_list.push_back();should delete the last element.


A sentence for the word doubly?

Use the word 'doubly' in a sentence:All these questions are hard, but this one was doubly hard.


Why you use doubly link list?

In a doubly linked list, you can iterate backwards as easily as forwards, as each element contains links to both the prior and the following element. You can also insert or delete an element without needing to iterate and remember the prior element's link. This comes at a cost. You are adding storage to each element for the second link, and you are adding processing overhead to the insert and delete operation. You have to determine the tradeoff.


Can we use doubly linked list as a circular linked list?

Yes. The tail node's next node is the head node, while the head node's previous node is the tail node.


How do you write a Java program to implement weighted queue using circular doubly linked list?

Add weights to the elements of the queue and use an algorithm to sort the queue every time an element is added.


What are the applications for circular linked lists?

A singly-linked circular list is useful for implementing queue data structures with minimum overhead. Normally we implement a queue with two pointers: one to the tail for insertions and one to the head for extractions. With a circular list we only need to maintain a single pointer to the tail because the tail always points "forwards" to the head (instead of null as it normally would), thus achieving constant-time access to both the head and tail via a single pointer. Circular linked lists are generally useful wherever "wraparound" is necessary. That is, from any given node in the list, we can traverse forwards with the guarantee that we will eventually arrive back at that same node. With doubly-linked circular lists we have the advantage of traversing in either direction (bi-directional traversal).


What does evenly and doubly even mean?

A number is even if it is divisible by 2. It is doubly even if it is divisible by 4.


What operation is supported in constant time by the doubly linked list but not by the singly linked list?

examples:- delete this node (identified by a pointer)- insert a new node before this node- replace this node with another node


Can you delete the head node from doubly linked list?

If by 'head node' you simply mean the first node, then yes; but if 'head node' means the special element which is not supposed to ever be deleted (aka sentinel node), then no.