answersLogoWhite

0


Best Answer

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.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can you delete the head node from doubly linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


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.


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.


what are the differences between singly link list and doubly link list?

singly linked list stores only the address of next node while doubly linked list stores the address of previous node and next node and hence it is called doubly linked list. In singly linked list only forward traversing is possible while in doubly linked list forward and backward traversal is possible.


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.


Does each node in a doubly linked list contain a link to the previous as well as the next node?

Yes, each node in a doubly linked list contain a link to the previous as well as the next node. That is the definition of the doubly linked list.


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


What is best and worst case of time complexity and space complexity of insert and delete operation in singly linked list doubly linked list?

When inserting or extracting at the end of a singly-linked list or at the beginning or end of a doubly-linked list, the complexity is constant time. Inserting or extracting in the middle of a list has linear complexity, with best case O(1) when the insertion or extraction point is already known in advance and a worst case of O(n) when it is not.


Which operation is perform more efficiently by doubly linked list than by single linked list?

zsd


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.


Write a algorithm for doubly linked list in c?

sorry


Progarm to delete previous node in linked list?

struct LinkedListNode { void* data; LinkedListNode* next; }; LinkedListNode* head; LinkedListNode* tmp; while (head) { tmp head->next; free(head); head tmp; }