Exemple #1
0
        /// 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;
            }
        }
Exemple #2
0
        /// 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;
            }
        }
Exemple #3
0
        public ChNode <dt> next;  //< next node

        /// Constructor for node
        public ChNode()
        {
            data = null;
            next = prev = null;
        }
Exemple #4
0
 /// 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)
 {
 }
Exemple #5
0
        /// Removes a node.
        /// Note the Remove() command delete just the Ch_node, not the pointed 'data' object

        public void Remove(ChNode <dt> mnode)
        {
        }
Exemple #6
0
 public void InsertBefore(ChNode <dt> mnode, dt mdata)
 {
 }
Exemple #7
0
 public void InsertAfter(ChNode <dt> mnode, dt mdata)
 {
 }
Exemple #8
0
 public void InsertBefore(ChNode <dt> mnode, ChNode <dt> newnode)
 {
 }
Exemple #9
0
 public void InsertAfter(ChNode <dt> mnode, ChNode <dt> newnode)
 {
 }