/// Insert data at the tail of the list public void AddTail(dt[] mdata) { ChNode <dt> nnode = new ChNode <dt>(); nnode.data = mdata; nnode.prev = tail; nnode.next = null; if (head == null) // first elem { head = nnode; tail = nnode; } else { tail.next = nnode; tail = nnode; } }
/// Insert data at the head of the list public void AddHead(dt[] mdata) { ChNode <dt> nnode = new ChNode <dt>(); nnode.data = mdata; nnode.prev = null; nnode.next = head; if (head == null) // first elem { head = nnode; tail = nnode; } else { head.prev = nnode; head = nnode; } }
public ChNode <dt> next; //< next node /// Constructor for node public ChNode() { data = null; next = prev = null; }
/// Removes a node and deletes its data. /// Note the Kill() commands remove and also use delete(data) to free the objects pointed by nodes!, public void Kill(ChNode <dt> mnode) { }
/// Removes a node. /// Note the Remove() command delete just the Ch_node, not the pointed 'data' object public void Remove(ChNode <dt> mnode) { }
public void InsertBefore(ChNode <dt> mnode, dt mdata) { }
public void InsertAfter(ChNode <dt> mnode, dt mdata) { }
public void InsertBefore(ChNode <dt> mnode, ChNode <dt> newnode) { }
public void InsertAfter(ChNode <dt> mnode, ChNode <dt> newnode) { }