示例#1
0
        public Node Copy()
        {
            Node copyNode = new Node(this.data);
            copyNode.next = this.next;
            copyNode.previous = this.previous;

            return copyNode;
        }
示例#2
0
        public void AddToEnd(Employee data)
        {
            if (next == null) {
                next = new Node(data);
                next.previous = this;

            } else {
                next.AddToEnd(data);
            }
        }
示例#3
0
        public void AddSortedByID(Employee data)
        {
            if (next == null) {
                next = new Node(data);

            } else if (data.employeeID < next.data.employeeID) {
                Node temp = new Node(data);
                temp.next = this.next;
                temp.previous = this;

                this.next.previous = temp;
                this.next = temp;

            } else {
                next.AddSortedByID(data);
            }
        }
示例#4
0
 public Node(Employee data)
 {
     this.data = data;
     this.next = null;
     this.previous = null;
 }