## programing

what the wrong for this code :

``````if (head==NULL)//1 if the list is embty
cout<<"NO element in linked list ";
else if {
if (head==tail){ ///2- if we have one node
}``````

how i can write the other case
if the addrese in first node
if the addrese between two node .-> more than two node .node before ande node after that addrese ..

.....

## Akill10 96

I'm not really understanding your question. But, going by your thread title, to delete a particular position, you would basically follow these steps.
1. Point iterator to the first position in list
2. Move the iterator forward until you reach your desired index(e.g. for loop)
3. Make the current nodes PREVIOUS node, point to the current nodes NEXT node.
4. Make the current nodes NEXT node, point to the current nodes PREVIOUS node.
5. Delete the current node.

``````<-(previous)->  <-(current)->  <-(next)->

<-(prevous)->  <-(next)->
<-(current)->

<-(prevous)->  <-(next)->``````

## programing

yes , what you understanded is true ..
. but , there is subcase ..
if the value is found maybe its in the head // i mean one node
or in the tail .
or between
position effect or not ?
how i can write those cases ?

## programing

``````void deleteCurrent(){
Node * prev = curr->prev;
Node * next = curr->next; //delete node between prev/next
prev->next = next;
next->prev = prev;
delete curr;
curr=next; //curr points to next node
}``````

this delete value with position ,, that between two node ..
is this case true //???