help getting logic for doubly linked list

Hey everyone,

I need a bit of help getting some logic down for a homework assignment. I need to delete the Nth node from a doubly linked list.

I know I just cant delete it out right. I have all the goodies including a templetized node class. I need help.

this is the code we're given:
1
2
3
4
5
6
7
8

template <typename T>
void doublyLinkedList<T>::deleteKthElement(const int item)
{


}



It accepts an int, and should go to the Nth node and delete it.

I appreciate the help again. Not asking for the answer, just logic to write it
It's helpful to draw pictures to understand operations like this (circles and arrows or something). Then you just have to think about where the arrows (links) need to go after the node is deleted, and the code which makes it happen.
Last edited on
Topic archived. No new replies allowed.