Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Double linked List - Removing Nodes

$
0
0
How do I remove a node by the element so that the linked lists still work?
This is what I have so far but its not working

 void DLinkedList::removeName(const Elem& name) {
	 int check = 0;
	 DNode*temp = header;

	 while(temp!=trailer)
	 {

		 if(temp->elem == name){
			 delete elem;
			 break;
		 }
		 temp = temp -> next;
	 }

 }

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>